I'm using Sequelize in node.js to save open and close times. I'm also using moment.js to format. Alter a FindOrCreate I'm doing this:
result.open = moment(hours.open, "hh:mma").format("YYYY-MM-DD HH:mm:ss");
result.save()
...
This works fine and the time gets formatted to MySQL's datetime format. The Problem is when I retrieve the time Seqquelize thinks it's a UTC time and converts it to EST (my server timezone).
I would prefer it to go into the database as UTC and come out the same way. Is there something I'm doing wrong? Why does Sequelize not convert it to UTC on insert but assumes it's UTC coming out? ALso, is there a way to not have it try to convert to my server timezone?
See Question&Answers more detail:os