Quantcast
Channel: Dave Copeland :ruby:
Viewing all articles
Browse latest Browse all 504

Article 0

$
0
0

Looking at Ruby's standard lib for Times and Dates. It's a mess like Java’s, but different.

Date is a year/month/day, but will initialize "today" based on ENV[“TZ”] due to use of tzset[1]

Time is actually a timestamp of seconds since UNIX epoch, effectively a timestamp in UTC, initializable from any time zone-specified timestamp. No real conversion methods

[Missing] - “Time of day" i.e. an hour/minute/second

Does any language stdlib get this stuff right?

[1]: man7.org/linux/man-pages/man3/


Viewing all articles
Browse latest Browse all 504