Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
$localStorage.doctorDateTime.push({
    fullDate : new Date(doctorDateTime)
    });

I passed date string in new Date and then save it to local storage but when i retrieve it from local storage it showing me this format:

2015-01-01T13:41:18.300Z
while if console.log(doctorDateTime). it is showing right date string
Posted
Updated 1-Jan-15 2:58am
v2

1 solution

This format is a valid UTC format.
You can convert it into any format and use accordingly.

Date.Parse can be used for this task - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900