Page 2 of 2

parsing date string gives NaN

Posted: Tue Aug 04, 2015 11:13 pm
by Ben Walker

You need to console log whatever you're retrieveing from the DB so you understand what format it appears in (whether there's a "T" in there, or a "Z", whether it has miliseconds etc).

Then use string methods to get a datestring that you can parse.


parsing date string gives NaN

Posted: Tue Aug 04, 2015 11:13 pm
by Ben Walker

If you retreive an object, I found best bate was to use some type of toString() method. Then once it's in a string it should be easier to manipulate.


parsing date string gives NaN

Posted: Wed Aug 05, 2015 1:32 am
by RK

Thanks for your response.toString didn't work for me. Used json.stringify to solve it