$F_TimeZoneInformation.standardName = $arg_TimeZone.GetValue("Std") $F_TimeZoneInformation.standardDate = ConverterTZI $F_TZI 12 "standardDate" $F_TimeZoneInformation.standardBias = [BitConverter]::ToInt32($F_TZI, 4) $F_TimeZoneInformation.daylightName = $arg_TimeZone.GetValue("Dlt") $...
Get-Date -DisplayHint Date 1. 获得系统当前的时间 Get-Date -DisplayHint Time 1. 获得年份 (Get-Date).Year 1. 获得日期对象后,将日期减少1天 (Get-Date).Date.AddDays(-1).ToString('u') 1. 以GUI方式设置日期时间# 注意:只有在有GUI的计算机才可以使用 timedate.cpl 1. 获得时区# Get-Timezone ...
} $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使用DST获取时区EN是的,您可以在IsDaylightSavingTime类上使用静态方法TimeZoneInfo从所需的D...
yyyy Year in 4-digit format HH:mm Time in 24-hour format - no seconds K Time zone offset from Universal Time Coordinate (UTC)For more information about .NET format specifiers, see Custom date and time format strings.Example 4: Get the date and time with a UFormat specifierIn...
Get-Content Get-ControlPanelItem(取得控制台項目) 僅限Windows 取得事件日志 僅限Windows Get-HotFix 僅限Windows Get-Item Get-ItemProperty 取得項目屬性值 Get-Location Get-Process Get-PSDrive Get-PSProvider Get-Service 僅限Windows Get-TimeZone 僅限Windows Get-Transaction 僅限Windows Get-WmiO...
此示例演示如何将日期值解释为其 UTC 等效项。 例如,此计算机设置为太平洋标准时间。 默认情况下,Get-Date返回该时区的值。 使用AsUTC参数将值转换为 UTC 等效时间。 PowerShell PS>Get-TimeZoneId : Pacific Standard Time DisplayName : (UTC-08:00) Pacific Time (US & Canada) StandardName : Pacific Sta...
Get-CimInstance-ClassNameWin32_Desktop 输出 SettingID Name ScreenSaverActive ScreenSaverSecure ScreenSaverTimeout --- --- --- --- --- NT AUTHORITY\SYSTEM False DESKTOP-CSSMBDR\Admin False .DEFAULT False 2.列出BIOS信息 命令 Get-CimInstance-ClassNameWin32_BIOS 输出 ...
既定では、Get-Date はそのタイムゾーンの値を返します。 AsUTC パラメーターを使用して、値を UTC の等価時刻に変換します。 PowerShell コピー PS> Get-TimeZone Id : Pacific Standard Time DisplayName : (UTC-08:00) Pacific Time (US & Canada) StandardName : Pacific Standard Time ...
PS> Get-TimeZone Id : Pacific Standard Time DisplayName : (UTC-08:00) Pacific Time (US & Canada) StandardName : Pacific Standard Time DaylightName : Pacific Daylight Time BaseUtcOffset : -08:00:00 SupportsDaylightSavingTime : True PS> (Get-Date -Date "2020-01-01T00:00:00").Kind Un...