My configuration is the time zone in Lisbon. When I do new Date()
, I get the current local date / time, whichFri Apr 28 2017 01:10:55 GMT+0100 (GMT Daylight Time)
When I get the ISO string with toISOString()
, it will apply the time zone, and I will get:
2017-04-28T00:10:55.964Z
The problem is that a few minutes ago the date was like this (yesterday):
2017-04-27T23:45:05.654Z
I tried moment.js (new to this) and I did something like this
document.write(moment('2017-04-28').format())
But I get this 2017-04-28T00:00:00+01:00
one that is not2017-04-28T00:00:00.000Z
I want to pass this value as a parameter of the restful method for its automatic analysis as a DateTime type, but if I pass the output from the moment.js format, it will be parsed as 2017-04-27 23:00:00.00
new Date()
new Date('2017-04-27')
( ), ISO, ,
2017-04-28T00:00:00.000Z
javascript, , toISOString() , , , ?
, , , .