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

DevGuru情報

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 に答える