I am using a simple method
Set dateTime = CreateObject("WbemScripting.SWbemDateTime") dateTime.SetVarDate (now()) wscript.echo "Local Time: " & dateTime wscript.echo "UTC Time: " & dateTime.GetVarDate (false)
Additional Information About SWbemDateTime
If you want to convert UTC back to local time, follow these steps:
Set dateTime = CreateObject("WbemScripting.SWbemDateTime") dateTime.SetVarDate now(),false REM Where now is the UTC date wscript.echo cdate(dateTime.GetVarDate (true))
Niederee
source share