Closed Thread
Results 1 to 4 of 4

Thread: Getting Time Zone

  1. #1
    mak
    mak is offline Newbie
    Join Date
    Feb 2007
    Posts
    2
    Rep Power
    0

    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:

    [HIGHLIGHT="Perl"]use POSIX (strftime);

    ($d = strftime("%z", localtime)) =~ s/(\d\d)(\d\d)/$1:$2/;

    print "$d\n";[/HIGHLIGHT]

    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?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    use POSIX qw(strftime);

  4. #3
    mak
    mak is offline Newbie
    Join Date
    Feb 2007
    Posts
    2
    Rep Power
    0
    That works! Thanks! What does the qw() mean?

  5. #4
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0
    qw = quote words

    is the equivalent of:

    use POSIX ("strftime");
    Last edited by KevinADC; 10-05-2007 at 11:15 PM.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Changing time zone to UTC
    By ki4jgt in forum Python
    Replies: 0
    Last Post: 03-23-2011, 12:45 PM
  2. Replies: 1
    Last Post: 03-31-2010, 10:46 PM
  3. Windows free zone?
    By temi in forum The Lounge
    Replies: 13
    Last Post: 08-14-2008, 10:35 AM
  4. Free Marketing Zone
    By mysticalone in forum Marketing
    Replies: 0
    Last Post: 01-25-2007, 12:35 AM
  5. The Slice Zone
    By xXHalfSliceXx in forum Site Reviews
    Replies: 6
    Last Post: 01-07-2007, 01:49 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts