Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

349
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!