I have project which contain some historical data of some customers. Data contains some date column which has date like 7272017
(MMddyyyy). I've been able to convert this datetype by using c# utility by using following code.
DateTime dt=DateTime.ParseExact("12022017", "MMddyyyy",
System.Globalization.CultureInfo.InvariantCulture);
Console.WriteLine(dt);
But i want to create a utility in javascript to convert this date into ISODate. By using new Date(07272017)
i am getting default date which is Thu Jan 01 1970 05:31:17 GMT+0500
. How can i parse format to parse function and convert the date into other format?
This is not the same question as Converting a string to a date in JavaScript
i dont want to convert ANY string .. i want to convert a specific date format which i have done in other language but looking for solution in javascript.
[EDIT] Moment.js is workable option but i want to convert my existing records stored in mongodb. I know i can't do it with mongo query... i am using nosqlbooster so i have access to shell which can run javascript code.. i am not sure how to link moment.js there?