0

我有一个在 PST 机器上创建/修改的文件。但是当我从印度标准时间访问这个文件时,修改日期将根据当前系统时区返回。(如此所述)有什么方法可以根据提供的时区获取此日期

var WshShell = Sys.OleObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");           
var objFile = fso.GetFile("c:\\abc.txt");
var date = objFile.DateLastModified + "";
4

1 回答 1

0

是的,您可以使用 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中计算日期差异

于 2012-02-14T21:18:06.587 回答