简体   繁体   中英

How do I understand the Date inside mongodb?

> new Date()
ISODate("2013-07-19T02:38:45.520Z")
> new Date().getDay()
5
>

Anyone can tell me why getDay returns 5 for 2013-07-19 ?

Because '2013-07-19' is a Friday. From MDN :

Returns the day of the week for the specified date according to local time, where 0 represents Sunday.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM