Is there a way to display timestamp in unix format to ISODate?
问题 We stored a date using unix timestamp in MongoDB, how do I get the date when I do the query? Is there a way to display timestamp in ISODate format? 回答1: Background A unixtime value represents seconds since the epoch (Jan 1, 1970). A JavaScript Date() represents milliseconds since the epoch. In MongoDB, ISODate() is a convenience wrapper for Date() that allows you to create dates from ISO strings in the mongo shell. If you use new Date() in the shell, it will return an ISODate() . Conversion