I want to parse isoutcdatetime "2011-03-18T00:00:00Z" to get "2011-03-18". Anyone knows how to parse it? Thanks
Asked
Active
Viewed 788 times
1 Answers
1
It looks like you just want the substring, which isn't parsing:
var dateString = "2011-03-18T00:00:00Z".substring(0, 10));

Andrew Marshall
- 95,083
- 20
- 220
- 214
-
I worry that if we substring like this it is not a general rule to get only date from isoutcdatetime. any more ideas? – Sinal Mar 03 '11 at 03:23
-
Have a look at this question: http://stackoverflow.com/questions/4829569/help-parsing-iso-8601-date-in-javascript – Andrew Marshall Mar 03 '11 at 03:24