作成 2010.01.08
更新 2014.05.07
VBScript で時刻を取得する
このサンプルでは現在の時刻を取得します。
Option Explicit
Dim time, strMon, strDay, strHour, strMin, strSec
Dim tempTimer, strMilli
time = Now()
tempTimer = Timer()
strMon = Right("0" & Month(time), 2)
strDay = Right("0" & Day(time), 2)
strHour = Right("0" & Hour(time), 2)
strMin = Right("0" & Minute(time), 2)
strSec = Right("0" & Second(time), 2)
strMilli = Right("000" & Int((tempTimer - Int(tempTimer)) * 1000), 3)

WScript.Echo Year(time) & "/" & strMon & "/" & strDay & " " & _
  strHour & ":" & strMin & ":" & strSec & "." & strMilli
タグ: VBScript

©2004-2017 UPKEN IPv4