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.?
-
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
Add a comment
|
1 Answer
'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')
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 :)