컴퓨터2010.01.28 01:00
http://www.u229.no/stuff/snippets/UTC.asp
http://www.paulsadowski.com/wsh/timestamp.htm

Sample output:
timestamp.vbs
1041812764

timestamp.vbs 1041812764
Mon Jan 6 00:26:04 2003

You can specify multiple timestamps on the command-line.

Please change the constant 'off' to reflect the offset in hours from UTC for your locale.

 
--------------------------------------------------------------------------------
 
An example script:

' Your timezone's offset, in hours, from UTC (change for your locale)
Const off = -5

args = WScript.Arguments.Count
if args = 0 then
 SecsSince = CLng(DateDiff("s", "01/01/1970 00:00:00", Now))
 wscript.echo SecsSince - 3600 * abs(off)
else
 for x = 0 to args - 1
  dt = DateAdd("s", WScript.Arguments.Item(x), "01/01/1970 00:00:00")
  fdt = FormatDateTime(DateValue(dt))
  ftm = FormatDateTime(TimeValue(dt))
  if Len(fdt) < 10 then
   fdt = space(10 - Len(fdt)) & fdt
  end if
  if Len(ftm) = 10 then
   ftm = " " & ftm
  end if
  ThisTime = fdt & " " & ftm
  Wscript.Echo WeekDayName(WeekDay(ThisTime), true) &_
  space(1) & MonthName(Month(ThisTime), true) & space(1) &_
  Day(ThisTime) & space(1) & right("00" & Hour(ThisTime), 2) &_
  ":" & right("00" & Minute(ThisTime), 2) & ":" & right("00" &_
  Second(ThisTime), 2) & space(1) & Year(ThisTime)
 next
end if

 
--------------------------------------------------------------------------------
 
Bare Functions

Function TS2Date(TS)
TS2Date = DateAdd("s", TS, "01/01/1970 00:00:00")
End Function

Function UDateNow()
UDateNow = CLng(DateDiff("s", "01/01/1970 00:00:00", Now))
End Function

Function UDate(ThisDate)
UDate = CLng(DateDiff("s", "01/01/1970 00:00:00", ThisDate))
End Function
Posted by Zasfe