Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
how to use moment js utc time to get a countries different timezone

I have the following populated list of timezones that a user can select example

{name: '(UTC-12:00) International Date Line West', offset: '-12:00:00'}
{name: '(UTC-11:00) Coordinated Universal Time-11', offset: '-11:00:00'}
{name: '(UTC-10:00) Aleutian Islands', offset: '-10:00:00'}
{name: '(UTC-06:00) Guadalajara, Mexico City, Monterrey', offset: '-06:00:00'}
{name: '(UTC-06:00) Saskatchewan', offset: '-06:00:00'}

when the user selects a timezone how do i get the actual time and date of the zone they selected?

i can get the following local time as follows

var today = Moment();
        this.date = today.format("dddd,D MMM YYYY");
this.times = Moment().format("HH:mm:ss");

But im not sure how to get the timezones of the different locations. so for example if they selected (UTC-12:00) International Date Line West how do i show the date and time of that location?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

  • Since your're using Moment.
  • you can use moment-timezone.js
  • Check docs here: https://momentjs.com/timezone/docs/

Example From Docs:

let moment = require('moment-timezone');
moment().tz("America/Los_Angeles").format();
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda