'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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
