我需要计算到将来某个时间点的剩余时间。我使用new Date()
来获取当前日期,例如:
Fri Oct 09 2020 09:59:21 GMT+0200 (Central European Summer Time)
在object中,如何计算到此时为止的剩余时间:
{
appointment_date: "Tue Oct 20 2020"
appointment_hour: "08:00 - 09:00"
}
我想以月为单位显示它,然后是周,然后是天,等等。如果它们是零,那么它们应该被省略。
转载请注明出处:http://www.yihangfood.com/article/20230526/1408725.html