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
'컴퓨터' 카테고리의 다른 글
IIS7 에서는 일반연결(http) 와 보안연결(https) 간 세션유지가 되지 않습니다. (1) | 2010.02.06 |
---|---|
데이터베이스 간략정보 추출 쿼리 (0) | 2010.01.28 |
2년전 백업 정보 삭제 쿼리(mssql 2000) (0) | 2010.01.27 |
WebDAV 인증 우회에 대한 취약점 (0) | 2010.01.27 |
IIS 파일확장자 우회취약점은 IIS6 에서만 동작합니다. (1) | 2009.12.30 |