MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/windowsdev/comments/1gjzxgj/command_for_getting_the_current_system_date_format/
r/windowsdev • u/MobyFreak • Nov 05 '24
I'm trying to determine the current system locale date format so I can format the dates correctly for the schtasks-create command.
Is there a cmd or powershell command that can get me this info?
2 comments sorted by
2
Do what the help text suggests - go to the region page in settings and the short date format is displayed there.
Or run date in cmd
date
C:\>date The current date is: Tue 11/05/2024 Enter the new date: (mm-dd-yy)
For PowerShell, it looks like that information is found in:
[System.Globalization.CultureInfo]::CurrentCulture.DateTimeFormat
You may specifically want the LongDatePattern or FullDateTimePattern.
2
u/jedwardsol Nov 06 '24
Do what the help text suggests - go to the region page in settings and the short date format is displayed there.
Or run
datein cmd2
u/Shendare Nov 06 '24
For PowerShell, it looks like that information is found in:
You may specifically want the LongDatePattern or FullDateTimePattern.