In message "[ruby-talk:7911] Re: Code sample for improvement"
on 00/12/22, "Conrad Schneiker" <schneik / us.ibm.com> writes:
>> zsh> ruby -e '#!/usr/bin/env ruby
>>
>> require "date"
>>
>> ("%d years %d months %d days %s\n" %
>> [ARGV[0].to_i.divmod 86400].map{|days,secs|
>> [Date.new0(days+5373485), Time.at(secs).gmtime]
>> }.map{|d,t|
>> [d.year-10000, d.month-1, d.mday-1,
>> "%d hours %d mins %d secs" % t.to_a.indices(2,1,0)]
>> }.shift).display
>>
>> ' 0123456789012346789
>> 3912189903 years 10 months 26 days 5 hours 39 mins 49 secs
>> zsh>
>
>Pretty clever joke.
>
>How about centuries and millenia (since we only have a few days left tell
>the next one).
I'd like to wait date.rb's support :-)
By the way, are the concepts of century or millennium defined by a
calender? I'm not sure I'm in the second millennium or the third...
# Sorry for off-topic.
-- gotoken