-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,365
  • 3
  • 36
  • 67

2 Answers2

2

PHP has a function for that: timezone_name_from_abbr

Francis Eytan Dortort
  • 1,397
  • 12
  • 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
  • 214,338
  • 71
  • 421
  • 539