T
Ted Byers
NB: I have seen information about using the system's settings, but
that is not relevant to this problem.
I have a number of DB tables that have datetime values defined WRT UTC
time. If all users could/would work with UTC, there'd be no problem.
I have stored, in a users table, the users' specific timezones. So
far so good. I can use Date::Manip to convert from UTC to each user's
timezone easily. That is great!
However, in many localities, there is a need to switch to and from a
daylight savings time, and I can use the time zones defined in
Date::Manip to specify which users would be using daylight savings
time, but the problem is that using something like "EST5EDT" in either
$from or $to Date_ConvTZ($date1,$from,$to1); does nothing (i.e. the
value returned is identical to $date1). In some respects, I was not
very surprised: unless there was some kind of database hidden in the
bowels of Date::Manip, it couldn't know when to switch to or from
daylight savings time based on the value of $date1. I would not have
a problem creating my own function to do the converstion (dispatching
to Date_ConvTZ using, in the above example, either EST or EDT
depending on the value of the date to be converted), but the problem
is to know when to use EST and when to use EDT (or CET vs CEST, or CST
vs CDT, MST vs MDT, &c.). The date on which the change happens is
different in different time zones (e.g. compare CET#CEST vs EST#EDT).
And I'd need this to be correct even though conventions on use of
daylight savings times are subject to change (as in the US a year or
two back).
So, is there a package that you can recommend that handles this
cleanly, or is there a database/flat data file that can be easily
loaded into an RDBMS such as MySQL, PostgreSQL, MS SQL Server, that I
could use to solve this? I have downloaded and installed a large
number of time related packages using PPM (Activestate Perl 5.10.0 on
Windows XP), but none of the ones I have examined address this
particular issue. I am so frustrated in my search on this that until
I find an adequate solution, the policy we've adopted is to put the
onus on the client to tell us whether or not he wants reports using
daylight savings times, and if so, when the transitions to and from
daylight savings time happens. I would be grateful if someone could
point me to an option that is more user friendly.
Thanks
Ted
that is not relevant to this problem.
I have a number of DB tables that have datetime values defined WRT UTC
time. If all users could/would work with UTC, there'd be no problem.
I have stored, in a users table, the users' specific timezones. So
far so good. I can use Date::Manip to convert from UTC to each user's
timezone easily. That is great!
However, in many localities, there is a need to switch to and from a
daylight savings time, and I can use the time zones defined in
Date::Manip to specify which users would be using daylight savings
time, but the problem is that using something like "EST5EDT" in either
$from or $to Date_ConvTZ($date1,$from,$to1); does nothing (i.e. the
value returned is identical to $date1). In some respects, I was not
very surprised: unless there was some kind of database hidden in the
bowels of Date::Manip, it couldn't know when to switch to or from
daylight savings time based on the value of $date1. I would not have
a problem creating my own function to do the converstion (dispatching
to Date_ConvTZ using, in the above example, either EST or EDT
depending on the value of the date to be converted), but the problem
is to know when to use EST and when to use EDT (or CET vs CEST, or CST
vs CDT, MST vs MDT, &c.). The date on which the change happens is
different in different time zones (e.g. compare CET#CEST vs EST#EDT).
And I'd need this to be correct even though conventions on use of
daylight savings times are subject to change (as in the US a year or
two back).
So, is there a package that you can recommend that handles this
cleanly, or is there a database/flat data file that can be easily
loaded into an RDBMS such as MySQL, PostgreSQL, MS SQL Server, that I
could use to solve this? I have downloaded and installed a large
number of time related packages using PPM (Activestate Perl 5.10.0 on
Windows XP), but none of the ones I have examined address this
particular issue. I am so frustrated in my search on this that until
I find an adequate solution, the policy we've adopted is to put the
onus on the client to tell us whether or not he wants reports using
daylight savings times, and if so, when the transitions to and from
daylight savings time happens. I would be grateful if someone could
point me to an option that is more user friendly.
Thanks
Ted