Skip to main content
10-Marble
August 18, 2014
Solved

Download all timezones

  • August 18, 2014
  • 1 reply
  • 1290 views

Can anyone think of a quick and easy way to get all the UTC Offset's of configured timezones? Or is it possible somewhere in my preferences settings that i have missed to display the timezone with +-(x) hours?

 

Any methods quicker than Googling them all gratefully received!

 

Alan

    Best answer by cdovholuk

    You're looking for the ones which java provides I take it?  Here's a simple custom object:


    String allOffsets = "";


    TimeZone.getAvailableIDs().each()


    {


      TimeZone tz = TimeZone.getTimeZone(it);


      allOffsets += tz.ID + " = " + tz.getOffset(System.currentTimeMillis()) + "\n";


    }


    allOffsets;


    Notice that you need to provide the date so that the offset can be calculated properly.

    Is that the sort of thing you're looking for?

    (some results of the scripto)

    Etc/GMT+12 = -43200000

    Etc/GMT+11 = -39600000

    Pacific/Midway = -39600000

    Pacific/Niue = -39600000

    Pacific/Pago_Pago = -39600000

    Pacific/Samoa = -39600000

    US/Samoa = -39600000
    ...

    ...

    1 reply

    cdovholuk5-Regular MemberAnswer
    5-Regular Member
    August 18, 2014

    You're looking for the ones which java provides I take it?  Here's a simple custom object:


    String allOffsets = "";


    TimeZone.getAvailableIDs().each()


    {


      TimeZone tz = TimeZone.getTimeZone(it);


      allOffsets += tz.ID + " = " + tz.getOffset(System.currentTimeMillis()) + "\n";


    }


    allOffsets;


    Notice that you need to provide the date so that the offset can be calculated properly.

    Is that the sort of thing you're looking for?

    (some results of the scripto)

    Etc/GMT+12 = -43200000

    Etc/GMT+11 = -39600000

    Pacific/Midway = -39600000

    Pacific/Niue = -39600000

    Pacific/Pago_Pago = -39600000

    Pacific/Samoa = -39600000

    US/Samoa = -39600000
    ...

    ...

    ablyth10-MarbleAuthor
    10-Marble
    August 18, 2014

    That's perfect!

    Thanks Clint,

    Alan