View Single Post
  #1 (permalink)  
Old 10-04-2007, 01:37 PM
mak mak is offline
Newbie
 
Join Date: Feb 2007
Posts: 2
Credits: 0
Rep Power: 0
mak is on a distinguished road
Default Getting Time Zone

How can I find the time zone? The end result I need to figure out if the date/time is in daylight savings or not. I've found:

Perl Code:
  1. use POSIX (strftime);
  2.  
  3. ($d = strftime("%z", localtime)) =~ s/(\d\d)(\d\d)/$1:$2/;
  4.  
  5. print "$d\n";

which gives me this error:

"Unquoted string "strftime" may clash with future reserved word at timezone.pl line 12."

But it does output "Eastern Daylight Time". Is there a better way to do this or is there a way I can remove the warning?
Reply With Quote

Sponsored Links