Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Unix  Timestamp  to  DateTime  

 Content of Unix Timestamp to DateTime.vbs
MD5 Hash: ADD8A1997B5EFE3CC49E1E05E84BBCF3
wscript.echo TimeStampToDateTime(342954300, false)
wscript.echo TimeStampToDateTime(342954300, true)

' -------------------------------
Private Function TimeStampToDateTime(iTimeStamp, bWithTimeZone)

Select Case bWithTimeZone

Case True
TimeStampToDateTime = DateAdd("s", iTimeStamp + CurrentTimeZone(), CDate("01.01.1970"))
Case False
TimeStampToDateTime = DateAdd("s", iTimeStamp, CDate("01.01.1970"))

End Select

End Function

' --------------------------------
Private Function CurrentTimeZone()

Dim OS
On Error Resume Next
For Each OS in GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
CurrentTimeZone = OS.CurrentTimeZone * 60
Next

End Function

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a