TotallyInformation / node-red-contrib-moment

Node-Red Node that produces formatted Date/Time output using the Moment.JS library. Timezone, dst and locale aware.
Apache License 2.0
34 stars 16 forks source link

Date = last month? #36

Closed SteveRMann closed 4 years ago

SteveRMann commented 4 years ago

The timestamp I am working with shows the date as August 15:
2020-08-15T02:52:34.000Z Yet after sending this through the moment node, it drops back to July 14: {"years":2020,"months":7,"date":14,"hours":22,"minutes":52,"seconds":34,"milliseconds":0}

Am I doing something wrong?

As soon as I hit return, I realized my mistake. Months and date counts from zero?

TotallyInformation commented 4 years ago

:) Yes, that is one of the most annoying "features" of JavaScript. If it wasn't that, I would have suggested a Timezone issue. Glad you got it sorted.