How can I convert the date "Mon Jul 01 08:00:00 IST 2019
" of type string to ISODate "2019-07-01T03:00:00.000Z
"?
Asked
Active
Viewed 1.8k times
1
-
For most purposes you should not want to convert a datetime string in one format to another format. Instead inside your program you should keep date and time in a proper date-time object, for example `ZonedDateTime` or `Instant`. Only when you need to give out a string, format your date and time into one. – Ole V.V. Jun 29 '19 at 10:52