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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -