Powershell Get-Date Timezone 在Powershell 中,我们可以使用 Get-Date 命令来获取当前的日期和时间。这个命令使用本机的时区设置,并返回当前时区中的日期和时间。 如果我们需要获取不同时区的日期和时间,我们可以使用 -TimeZone 参数来指定不同时区的值。下面是一个例子: Get-Date -TimeZone 'Pacific Standard ...
$F_TimeZoneInformation.standardDate = ConverterTZI $F_TZI 12 "standardDate" $F_TimeZoneInformation.standardBias = [BitConverter]::ToInt32($F_TZI, 4) $F_TimeZoneInformation.daylightName = $arg_TimeZone.GetValue("Dlt") $F_TimeZoneInformation.daylightDate = ConverterTZI $F_TZI 28 "daylightD...
根據預設,會 Get-Date 傳回該時區的值。 使用 AsUTC 參數將值轉換為 UTC 對等時間。PowerShell 複製 PS> Get-TimeZone Id : Pacific Standard Time DisplayName : (UTC-08:00) Pacific Time (US & Canada) StandardName : Pacific Standard Time DaylightName : Pacific Daylight Time BaseUtcOffset :...
$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()...
在PowerShell 中使用Get-TimeZone获取时区 Get-TimeZonecmdlet 显示系统上使用的当前时区。 Get-TimeZone 输出: Id : Nepal Standard TimeDisplayName : (UTC+05:45) KathmanduStandardName : Nepal Standard TimeDaylightName : Nepal Daylight TimeBaseUtcOffset : 05:45:00SupportsDaylightSavingTime : False ...
Get-Location Get-Process Get-PSDrive Get-PSProvider Get-Service Get-TimeZone Invoke-Item Join-Path Move-Item Move-ItemProperty 新增專案 New-ItemProperty New-PSDrive New-Service Pop-Location Push-Location Remove-Item Remove-ItemProperty Remove-PSDrive ...
Get-Location Get-Process Get-PSDrive Get-PSProvider Get-Service Windows only Get-TimeZone Windows only Get-Transaction Windows only Get-WmiObject Windows only Invoke-Item Invoke-WmiMethod Windows only Join-Path Limit-EventLog Windows only Move-Item Move-ItemProperty New-EventLog Windows ...
虽然这可能有点...幼稚,但这是一种不用switch语句就可以获得an缩写的方法:
Summary: Use PowerShell to pull out specify TimeZone data from an object. I have data retrieved from an external source that contains different time zone IDs like W. Europe Standard Time, AUS Eastern Standard Time, etc. How can I get the current date time value of it...
Get-TimeZoneEste comando obtém o fuso horário atual.Exemplo 2: Obter fusos horários que correspondem a uma cadeia de caracteres especificadaPowerShell Copiar Get-TimeZone -Name "*pac*" Pacific Standard Time (Mexico) (UTC-08:00) Pacific Time (US & Canada) Pacific Standard Time SA Pac...