Skip Menu |

This queue is for tickets about the Date-Calc CPAN distribution.

Report information
The Basics
Id: 30723
Status: rejected
Priority: 0/
Queue: Date-Calc

People
Owner: Nobody in particular
Requestors: catone [...] agava.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Time_to_Date do not use timezone
Date: Wed, 14 Nov 2007 13:51:05 +0300
To: bug-Date-Calc [...] rt.cpan.org
From: "catone [...] agava.com" <catone [...] agava.com>
Good time of the day. Time_to_Date function do not use timezone information, so when yo are comparing Today() result with Time_to_Date(Time()) result - it gives difference. Suggestions: I think that use timezone information or not should be a flag in function arguments. Env: perl 5.8.8 FreeBSD 6.2 TZ: GMT+3 Current workaround: Date::Calc::Time_to_Date(time()+Time::Timezone::tz_offset()) -- Денис Покатаев (catone@agava.com)
On Wed Nov 14 05:52:23 2007, catone@agava.com wrote: Show quoted text
> Good time of the day. > > Time_to_Date function do not use timezone information, so when yo are > comparing Today() result with Time_to_Date(Time()) result - it gives > difference. > > Suggestions: > I think that use timezone information or not should be a flag in > function arguments. > > Env: > perl 5.8.8 > FreeBSD 6.2 > TZ: GMT+3 > > Current workaround: > Date::Calc::Time_to_Date(time()+Time::Timezone::tz_offset()) > -- > Денис Покатаев (catone@agava.com)
This is the expected and documented behaviour. There are other routines in the module which do take the timezone into account precisely for that purpose. Time_to_Date() is more for conversions than it is intended for calculations.