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

346
Visualizações
Moment js time format not supported in Mozilla and safari browser?

I have been working on ActiveAdmin in Rails where we use haml for view.

So Ruby stores the date in this format 2022-04-06 12:00:00 UTC in the Database.

But i need to show the Date in 2022-04-06 17:30:00 IST in this format.

Current situation is I have done some analysis on this and I decided to use moment.js

var timestamp = '2022-04-06 12:00:00 UTC';
var dateFormat = 'YYYY-DD-MM HH:mm:ss ZZ';
var testDateUtc = moment.utc(timestamp);
var localDate = testDateUtc.local();
console.log(localDate.format(dateFormat));

So for this I successfully got 2022-04-06 17:30:00 +0530 this format but the problem is this is supported to Chrome but it shows Invalid Date for Firefox and Safari Browsers.

Can anyone help me to try get same format as I mentioned above or the successfull one to support on Firefox and Safari Browser.

about 4 years ago · Santiago Trujillo
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