Hi,
I'm trying to provide localised times for my website users and I'm using the following code
use Time::Local;
#if user is english $ENV{TZ} = "CET"; # if the user is spanish $ENV{TZ} = "CET";
# I then have values for a date&time coming out of a column in the database
# I use a DATE_FORMAT function in the sql so my datetime comes out like
# 2nd March 14:00 # I thought putting this into localtime function of Time::Local module would
produce
# date and CET time
my $localisedstartdatetime = localtime($start);
# however print $localisedstartdatetime # this returns epoch time (Thu Jan 1 00:00:00 1970)
# when I format the date like # 00, 00 , 14:00:00 , 2, 3, 2003 # i.e seconds, minutes etc; I get same result
I know I'm probably not understanding the time format very well,
Can anyone advise?
Poorly worded explanation.
1) You're setting CET for both users - typo ?
2) timelocal (if that's what you are using doesn't use :'s, month is 0-based (not 1-based) and year should work with/without the - 1900.
3) create a small code snippet (that runs and possibly fails to produce the correct results) and submit the code. Hardcode the date that you get back from the query (since we can't reproduce that part).
-- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs