From: valodzka Date: 2009-03-23T19:26:30+09:00 Subject: [ruby-core:23005] Re: Ruby Time > I think you'd better try that anyway. Tips: don't forget Windows. I haven't forget about Windows. Windows practicaly always used as a desktop, so regular updates of timezones database isn't realy important. > Soryy, I thought EDT was -0500. Then can you show me how to generate > Sun, 01 Nov 2009 01:30:00 EST ? >> TimeZone.local "America/New_York" => # >> Time.local(0, 30, 1, 1, 11, 2009, nil, nil, false, "America/New_York") => 2009-11-01 01:30:00 -0500 >> Time.local(0, 30, 1, 1, 11, 2009, nil, nil, true, "America/New_York") => 2009-11-01 01:30:00 -0400 These examples use current ruby Time API which, of course, can be improved. >>> >>> 2) Time, except small range, remains unportable between different > >>> platforms. > >> That's unavoidable. Time is, or at least has an aspect of, an interface > >> between ruby and a platform. > > That's unavoidable only in two places - requiring current time and > > current time zone. Everything else can be handled (and has handled) in > > library. > > Don't forget there are many methods that return Time objects: File.atime, > File.mtime, File.ctime, ... Sorry, I realy forget about this. But, anyway, these results can be easy converted from and to internal presentation. -- Pavel