是的,您可以使用 VBS 中的 DateDiff 函数来执行此操作:
http://www.devguru.com/technologies/vbscript/quickref/datediff.html
开发大师信息
DateDiff(Interval, Date1, Date2, FirstDayofWeek, FirstWeekofYear)
The DateDiff function calculates the amount of time between two different dates.
There are three mandatory arguments.
Interval
The Interval argument defines the the type of time interval you wish to use to
calculate the time difference.
Only the following settings can be used. You must place the setting inside a
pair of double quotes.
| SETTING | DESCRIPTION |
|:--------|:-------------|
| YYYY | Year |
| Q | Quarter |
| M | Month |
| Y | Day Of Year |
| D | Day |
| W | WeekDay |
| WW | Week Of Year |
| H | Hour |
| N | Minute |
| S | Second |
在 javascript 中,你可以这样做:
如何在javascript中计算日期差异