NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Other Way Round? (Score:1)
Suppose that
DateTimewere the other way round, and defaulted to the local timezone. Then somebody could've made an equivalent blog post to yours but comparingDateTime->nowwithgmtimeand complaining that they are different!There are 2 different possible behaviours. Obviously the module can only do 1 of them by default.
I've been inconvenienced the other way round, when I discovered that our MySQL database was storing timestamps in local time rather than UTC — and not storing the timezone. So this means that in autumn when the clocks go back we have 1 hour's worth of recorded times that actually represent 2 hours' data, and no way of distinguishing them.
Smylers
Reply to This
Re:Other Way Round? (Score:2)
Sure, that doesn't mean that everyone should expect that or that the developers of DateTime are morons. They ju
Re:Other Way Round? (Score:1)
E.g., in your example, the only thing we know about your timezone is that it is '+0400' now, but we don't know what DST rules you have. So instead of guessing the correct timezone, DateTime chooses to let the user decide.
Re:Other Way Round? (Score:1)
Except that it isn't it's more like floating time, because it doesn't also note the timezone. That's just wrong, because it means that MySQL's timestamps don't map to a particular moment in time, but to several possible moments. And even if you know the physical location, because of daylight-saving time that isn't good enough.
I don't mind at all which timezone MySQL uses to display its times. And I certainly don't
Re:Other Way Round? (Score:2)
You could also note that it displays the date by default in ISO8601 format, which has the fields in an order that most humans don't use in their day-to-day lives.
I do, now, ever since I first used DateTime and thought, "What is that weird format, and why do they use it?"
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers