There is a problem with Heroku. It automatically calculates it in UTC.
the code
var tms = 1492554237000
console.log(moment(tms).format("YYYY-MM-DD HH:mm:ss"))
console.log(moment.utc(tms).format("YYYY-MM-DD HH:mm:ss"))
local output
2017-04-19 06:23:57
2017-04-18 22:23:57
heroku server server
2017-04-18 22:23:57
2017-04-18 22:23:57
I solved this by setting a timestamp.
if (moment().utcOffset() == -0){
// for server
tms += 28800000
}
Heroku new server output
2017-04-19 06:23:57
2017-04-19 06:23:57
source
share