J
Joel VanderWerf
Bill said:From: said:It's definitely an incompatibility, though, in the sense that it has
the potential to create a category of programs that will run under
JRuby but not (original) Ruby.
I did have a surprise like this, just a couple days ago:
Linux:
$ ruby -ve 'p Time.now.strftime("%F %T")'
ruby 1.8.4 (2005-12-24) [i686-linux]
"2006-10-07 19:05:01"
Windows:
ruby 1.8.4 (2005-12-24) [i386-mswin32]ruby -ve 'p Time.now.strftime("%F %T")'
" "
Thanks for the warning.
The moral of the story is trust ri more than man, if you care about
portability:
[~] ri strftime | grep '%[FT]'
[~] man strftime | grep '%[FT]'
Reformatting strftime(3), please wait...
%F Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99)
ing the seconds, see %T below.
%T The time in 24-hour notation (%H:%M:%S). (SU)
%F conversion is in C99 and POSIX 1003.1-2001.