In the year 2525

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 -ve 'p Time.now.strftime("%F %T")'
ruby 1.8.4 (2005-12-24) [i386-mswin32]
" "

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top