-1

I need to get timezone by name from PST, PDT, EST etc information. Such as

EST = America/New_York PDT = America/Los_Angeles

I have PST, EST string and I need a standard timezone like above within this timezone area. How can I achieve this? So it will like this When I get EST it will generate America/New_York When PDT it will generate America/Los_Angeles etc..

Rejoanul Alam
  • 5,435
  • 3
  • 39
  • 68

2 Answers2

1

PHP has a function for that: timezone_name_from_abbr

Francis Eytan Dortort
  • 1,407
  • 14
  • 20
1

In general, you should not do this. Time zone abbreviations are often ambiguous. CST has 5 different interpretations, etc. See this list.

Functions like timezone_name_from_abbr exist in PHP, but they only return the first of the time zones that happen to match.

See these related questions:

Community
  • 1
  • 1
Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575