I need to convert unixtimestamp to date format in javascript. From the backend Db the date is Dec 31, 2025. But when parsing the date like below it is showing Dec 30, 2025. (Note. I am using US/Central time zone)
var unixdate = "/Date(1767119400000)/"; // This is how I receive date from DB return moment.utc(moment(parseInt(unixdate.replace('/Date(', '').replace(')/', '')))).format('MMM DD, YYYY'); // Giving, "Dec 30, 2025" //Expected is "Dec 31, 2025"
Note: I saw two similar questions related to one day difference. But those did not worked for me. And they are different from unix timestamp Moment.js sets dates to 1 day behind MomentJs Format One Day Behind
Any suggestion would be helpful.
2.1m questions
2.1m answers
60 comments
57.0k users