javascript - JQuery string casting as date and adding an hour -
i'm working api returns dates in following format:
2017-07-28t12:36:17z
i'm used working unix timestamps. need add hour time segment in order account british summer time.
can suggest how can cast data date, add hour , output time segment, please?
this utc formatted date, includes time string.
you can cast javascript date using date
constructor, e.g:
var testdate = new date('2017-07-28t12:36:17z'); console.log(testdate) // fri jul 28 2017 13:36:17 gmt+0100 (gmt daylight time)
once js date object, can manipulate need.
Comments
Post a Comment