Skip to content

Instantly share code, notes, and snippets.

@mitsuji
Created September 5, 2011 09:19
Show Gist options
  • Save mitsuji/1194535 to your computer and use it in GitHub Desktop.
Save mitsuji/1194535 to your computer and use it in GitHub Desktop.
Posix Time in VBScript
Function GetPosixTimeStr()
Dim nMinutesInDay
nMinutesInDay = 60 * 60 * 24
Dim nMinutesNow
nMinutesNow = CDbl(Now) * nMinutesInDay
nMinutesNow = nMinutesNow -( 9 * 60 * 60 ) '' UTC
Dim nMinutesEpoch
nMinutesEpoch = DateSerial(1970,1,1) * nMinutesInDay
GetPosixTimeStr = CStr(nMinutesNow - nMinutesEpoch)
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment