current time in different timezones incl DST

Discussion in 'Perl Misc' started by Marcus, Aug 29, 2004.

  1. Marcus

    Marcus Guest

    Im currently calculating the current time for cities around the globe,
    based on my servers time, trying to keep track on DST dates in a
    separete file to make it accurate(ish).

    Im sure there are solid solutions out there to do this? Eg, print the
    current time in New York, Berlin, Sydney etc.

    Thanks for any suggestions
    M
     
    Marcus, Aug 29, 2004
    #1
    1. Advertising

  2. Marcus wrote:

    > Im currently calculating the current time for cities around the globe,
    > based on my servers time, trying to keep track on DST dates in a
    > separete file to make it accurate(ish).
    >
    > Im sure there are solid solutions out there to do this? Eg, print the
    > current time in New York, Berlin, Sydney etc.
    >
    > Thanks for any suggestions
    > M


    Screen scrape the offsets from http://www.timeanddate.com/worldclock/

    gtoomey
     
    Gregory Toomey, Aug 29, 2004
    #2
    1. Advertising

  3. Marcus <> wrote:
    > Im currently calculating the current time for cities around the globe,
    > based on my servers time, trying to keep track on DST dates in a
    > separete file to make it accurate(ish).


    > Im sure there are solid solutions out there to do this? Eg, print the
    > current time in New York, Berlin, Sydney etc.


    I would normally just use the OS's support for this..

    my @cities_to_timezone = (
    [ "New York", "US/Eastern" ],
    [ "Berlin", "Europe/Berlin"],
    [ "Sydney", "Australia/NSW"],
    );

    foreach (@cities_to_timezone)
    {
    $ENV{'TZ'} = $_->[1];
    print $_->[0], ": ", scalar localtime, "\n";
    }

    --
    Darren Dunham
    Senior Technical Consultant TAOS http://www.taos.com/
    Got some Dr Pepper? San Francisco, CA bay area
    < This line left intentionally blank to confuse you. >
     
    Darren Dunham, Sep 1, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. js
    Replies:
    1
    Views:
    791
  2. Dirk Hagemann

    Countdown timer for different timezones

    Dirk Hagemann, Jul 6, 2006, in forum: Python
    Replies:
    1
    Views:
    476
    Marc 'BlackJack' Rintsch
    Jul 6, 2006
  3. reppisch

    time() sleep() and dst

    reppisch, Oct 27, 2006, in forum: C Programming
    Replies:
    14
    Views:
    524
    Random832
    Nov 20, 2006
  4. epicwinter
    Replies:
    11
    Views:
    626
    kevin cline
    Apr 27, 2007
  5. Replies:
    0
    Views:
    225
Loading...

Share This Page