



![]() |
Marcus Nasarek has written an article for Linux-magazine about BASH and MS PowerShell. It’s nice to read because he took the time to get to know MS Powershell.
Read at source: Linux-magazine




Thanks to Martijn Balink we can now use unix time stamps with VBScripts. I mostly use it when scripting against a MySQL database. The script:
function getunixtime(fyear, fmonth, fday, fhour, fmin, fsec)
 ’ *** GENERATE UNIX-TIMESTAMP ***
 startdate = DateSerial(1970, 1, 1) ‘ Returns January 1, 1970.
currentdate = DateSerial(fyear,fmonth,fday)
 days = currentdate-startdate
 secondsperday = 24*3600
 secondstoday = (fhour * 3600) + (fmin * 60) + fsec
unixtimestamp = ((days * secondsperday) + secondstoday)
 for each objOs in getobject(“winmgmts:”).InstancesOf(“Win32_ComputerSystem”)
 curTZ = objOs.CurrentTimeZone
  curDST = objOs.DayLightinEffect Next
 if curDST then
  ’ *** Daylight Savings Time is active, Greenwich Time is 1 hour
  ’ *** earlier than WMI tells you.
  curTZ = curTZ -60
  unixtimestamp = unixtimestamp – 3600
 END IF
 ’ ** terug rekenen van huidige tijdzone naar GMT tijd.
 unixtimestamp = unixtimestamp – (curTZ*60)
 getunixtime = unixtimestampend function
The scripts calculates the time in msec from 01 january 1970 to the current date and time. The time zone your in is also implemented in the calculation of the script. So it should give you the current date in msec. Have fun with it and let me know what you think.


More Options ...
Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 