If you want to obtain the current date and time on a Windows system from a command prompt, you can use
date /t
and time /t
-
if you omit the /t
you will be prompted to change the values.C:\>date /t Thu 01/28/2016 C:\>time /t 10:38 PM
You can also obtain the information using a
Windows Management Instrumentation Command-line command,
wmic path win32_localtime get *
. Times will be shown in
24-hour clock format,
aka "military time", so 10 PM is hour 22.
C:\>wmic path win32_localtime get * Day DayOfWeek Hour Milliseconds Minute Month Quarter Second WeekInMonth Year 28 4 22 47 1 1 42 5 2016 C:\>
You can format the display of the information using the /format
option, e.g., you can put it in a list format.
C:\>wmic path win32_localtime get * /format:list Day=28 DayOfWeek=4 Hour=22 Milliseconds= Minute=45 Month=1 Quarter=1 Second=50 WeekInMonth=5 Year=2016 C:\>