Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一定是使用了错误的关键字,因为我认为这不会太难。但不知何故,我没能找到它。例如,您经常会在收到的邮件中看到上周的邮件只是说它是在星期一或星期二收到的。较早的邮件显示实际日期。
有没有人可以告诉我如何从保存的日期获得星期几以及如何检查它是否在过去 6 天内?
谢谢
您可以检查保存的日期时间和当前日期时间的差异是否小于 604800000(一周中的毫秒数)。