I know it's not recommended to store MomentJS objects in databases (although I don't really understand why). I'm having some bizarre problems storing them: my local MongoDB vs. the remote MongoLab seem to be outputting slightly different date/times (is this because of timezone difference?).
For example:
When I save: moment(1 + '-' + 2014, 'Q-YYYY')
MongoLab: 1388534400000
Local MongoDB: 1388563200000
That difference comes out to 8 hours.
In order to fix this problem, should I convert my Moment objects to ISO strings with .toISOString()
? I'm also interested in why this problem happens, if anyone has the answer to that.