node.js - Javascript date parse error? -
this question has answer here:
- javascript creating date wrong month 2 answers
let date = new date("2017-09-12t12:00:00"); console.log(date.getutcmonth());
here expecting log 09 month it's logging 08. year, day , hour , minute gets parsed correctly though. what's going on here? how can extract 09 above date string?
the getutcmonth()
zero-based value — 0 january.
for more info: https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/date/getutcmonth
Comments
Post a Comment