Zasfe
Zasfe's memory
Zasfe
전체 방문자
오늘
어제
  • 분류 전체보기 (143)
    • 이야기 (50)
    • 뜻알기 (1)
    • 컴퓨터 (91)

인기 글

최근 글

태그

  • webknight
  • ASP
  • Microsoft Windows 2000 Scripting Guide
  • 배치파일
  • Autoit
  • cmd
  • 생각
  • 저장프로시저
  • Function
  • IIS
  • MSSQL2K
  • nslookup
  • web.config
  • webknight 2.2
  • 홈페이지 보안 강화도구
  • Skin
  • 캐슬
  • IIS7
  • MSSQL
  • 보안
  • webshell
  • webknight2.2
  • Security
  • Castle
  • error
  • webknight2.1
  • VBScript
  • backup
  • webhacking
  • rsync
hELLO · Designed By 정상우.
Zasfe

Zasfe's memory

컴퓨터

UTC 시간을 확인하기 위한 스크립트

2010. 1. 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

'컴퓨터' 카테고리의 다른 글

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
    '컴퓨터' 카테고리의 다른 글
    • IIS7 에서는 일반연결(http) 와 보안연결(https) 간 세션유지가 되지 않습니다.
    • 데이터베이스 간략정보 추출 쿼리
    • 2년전 백업 정보 삭제 쿼리(mssql 2000)
    • WebDAV 인증 우회에 대한 취약점
    Zasfe
    Zasfe
    느낌. 기억

    티스토리툴바