Date/Time

Commands

Date & Time

date /t && time /t

Date and time (/t prevents changing value)

cmd /c "date /t && time /t"

Date and time

wmic os get localdatetime

Date and time

wmic path Win32_LocalTime get

Date and time

powershell Get-Date

Date and time

powershell [System.DateTime]::Now

Date and time

powershell [System.DateTime]::UtcNow

Date and time in UTC

powershell (Get-Date).ToLongDateString()

Date in long format

powershell (Get-Date).ToLongTimeString()

Time in long format

powershell (Get-Date).DayOfWeek

Day of the week

powershell Get-WmiObject Win32_LocalTime

Time

powershell Get-CimInstance Win32_LocalTime

Time details

Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object LocalDateTime
Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object -ExpandProperty LocalDateTime
Get-CimInstance -ClassName Win32_LocalTime | Select-Object -Property Hour, Minute, Second, caption

Timezone

tzutil /g

Timezone

wmic timezone get caption

Timezone

wmic path Win32_TimeZone get Caption

Timezone

powershell Get-TimeZone

Timezone

wmic os get currenttimezone /format:list

Timezone details

powershell [System.TimeZoneInfo]::Local

Timezone details

powershell Get-WmiObject Win32_TimeZone

Timezone details

powershell Get-CimInstance Win32_TimeZone

Timezone details

[System.TimezoneInfo]::Local

Timezone details

Registry Locations

Time Zone Information: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation This key contains information about the currently set timezone, including the name, bias, and daylight saving time settings.

Time and Date Formats: HKEY_CURRENT_USER\Control Panel\International This key stores user-specific settings related to date and time formats, such as short date format, long date format, time format, and first day of the week.

Internet Time Settings: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers This key contains information about the Internet time servers that Windows can synchronize with.

Automatic Time Synchronization Settings: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters This key includes parameters for the Windows Time service, which is responsible for synchronizing the computer's clock with a network time protocol (NTP) server.

Daylight Saving Time Update Configuration: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones This key contains subkeys for each time zone, including information about daylight saving time rules and adjustments.

User-specific Time Zone Settings (if different from the system default): HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones Similar to the system-wide time zone settings, but specific to the current user.

Last updated

Was this helpful?