10 Jul 2008 @ 9:32 AM 

 

officialpenguin[1]   powershell

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

Tags Tags: ,
Categories: Bash, Linux, Microsoft, PowerShell
Posted By: Richard
Last Edit: 10 Jul 2009 @ 07 30 PM

EmailPermalinkComments (0)
 13 Mar 2007 @ 3:18 PM 

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 = unixtimestamp

end 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.

Tags Tags: , , ,
Categories: VBScripts
Posted By: Richard
Last Edit: 10 Jul 2009 @ 07 33 PM

EmailPermalinkComments (1)
\/ More Options ...
Change Theme...
  • Users » 62
  • Posts/Pages » 19
  • Comments » 1
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About me



    No Child Pages.