I'm unable to parse date in angularjs, where date is coming from database and instead of showing correct date which is in database, it is showing me '0001-01-01T00:00:00'.Do I need to convert it? Is there any way in angular that convert the date.?
asked Sep 16, 2014 at 12:26
Junaid Zubair
551 gold badge4 silver badges13 bronze badges
-
1in which format do you get the date from the database? and how are you trying to parse it? some code plzJenson– Jenson2014年09月16日 12:29:08 +00:00Commented Sep 16, 2014 at 12:29
-
it is in date format getting from sql server.Junaid Zubair– Junaid Zubair2014年09月16日 12:53:01 +00:00Commented Sep 16, 2014 at 12:53
1 Answer 1
'0001-01-01T00:00:00' is a unix format (ISO 8601 or another). This format is natively supported by javascript.
If you want to convert it in a readable date, do :
var myDate = new Date('0001-01-01T00:00:00')
answered Sep 16, 2014 at 12:53
benek
2,1682 gold badges28 silver badges39 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
Junaid Zubair
Sort out the problem.. Thanks benek
benek
You're welcome. Do not hesitate to check my answer if it is the right one :)
default