cls
function ConverterTZI($arg_tzi,$arg_startIndex,$name="NULL")
{
$SYSTEMTIME = 1 |select wYear,wMonth,wDayOfWeek,wDay,wHour,wMinute,wSecond,wMilliseconds,Name
Add-Member -InputObject $SYSTEMTIME -MemberType ScriptMethod Ini{
$index = $arg_startIndex
$this.wYear = [BitConverter]::ToInt16($arg_tzi, $index)
$this.wMonth = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wDayOfWeek = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wDay = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wHour = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wMinute = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wSecond = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wMilliseconds = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.Name = $name
}
Add-Member -InputObject $SYSTEMTIME -MemberType ScriptMethod ToString -Force{
"$($this.name) =(wYear =$($this.wYear),wMonth =$($this.wMonth),wDayOfWeek =$($this.wDayOfWeek),wDay =$($this.wDay),wMinute =$($this.wMinute),wSecond =$($this.wSecond),wMilliseconds =$($this.wMilliseconds))"
}
$SYSTEMTIME.Ini()
Export-Clixml -InputObject $SYSTEMTIME -Path "SYSTEMTIME.xml" -Confirm:$false
return $SYSTEMTIME
}
$TimeZones = Get-ItemProperty "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time"
$TZI = $TimeZones.TZI
$standardDate = ConverterTZI $TZI 12 "standardDate"
$daylightDate = ConverterTZI $TZI 28 "daylightDate"
$standardDate.tostring()
$daylightDate.tostring()
function ConverterTZI($arg_tzi,$arg_startIndex,$name="NULL")
{
$SYSTEMTIME = 1 |select wYear,wMonth,wDayOfWeek,wDay,wHour,wMinute,wSecond,wMilliseconds,Name
Add-Member -InputObject $SYSTEMTIME -MemberType ScriptMethod Ini{
$index = $arg_startIndex
$this.wYear = [BitConverter]::ToInt16($arg_tzi, $index)
$this.wMonth = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wDayOfWeek = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wDay = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wHour = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wMinute = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wSecond = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.wMilliseconds = [BitConverter]::ToInt16($arg_tzi, ($index+=2))
$this.Name = $name
}
Add-Member -InputObject $SYSTEMTIME -MemberType ScriptMethod ToString -Force{
"$($this.name) =(wYear =$($this.wYear),wMonth =$($this.wMonth),wDayOfWeek =$($this.wDayOfWeek),wDay =$($this.wDay),wMinute =$($this.wMinute),wSecond =$($this.wSecond),wMilliseconds =$($this.wMilliseconds))"
}
$SYSTEMTIME.Ini()
Export-Clixml -InputObject $SYSTEMTIME -Path "SYSTEMTIME.xml" -Confirm:$false
return $SYSTEMTIME
}
$TimeZones = Get-ItemProperty "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time"
$TZI = $TimeZones.TZI
$standardDate = ConverterTZI $TZI 12 "standardDate"
$daylightDate = ConverterTZI $TZI 28 "daylightDate"
$standardDate.tostring()
$daylightDate.tostring()