Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
Get timezone abbreviation from timezone name

How can we find time zone abbreviation from time zone name. Is there any library which we can use to get it.

e.g.:
Input- America/Los_Angeles
Output- PDT

I tried using

usertimezone = America/Los_Angeles
print(new Date().toLocaleTimeString('en-us',{timeZone: usertimezone, timeZoneName:'short'}).split(' ')[2]);

output- PDT

But we need to provide locale. For different marketplaces locale would be different. If locale is incorrect then it provides answer based on GMT+offset.

E.g. while using time zone as "Asia/Calcutta" output is GMT+5:30. But with locale 'en-in' output is IST

Is it possible to do with plain JavaScript or a framework or library?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda