I'm rusty on .bat files, but in PowerShell, the following will give you the string you want:
get-date -Uformat "%Y-%m-%d"
Keith
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am attempting to create filenames in a command file using the DATE command. However, I want to change the format from day mm-dd-yyyy to yyyy-mm-dd and remove the day. Here is an example: Webcam-2018-07-12. Currently the DATE would make this Webcam-Thu 07-12-2018. I found a bat file that has this code in it: %DATE:/=_% and can create the file name using this but not in the date format I wish to use. Is there a way to change the date format so I can obtain the format that I wish to use? Please help!
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I'm rusty on .bat files, but in PowerShell, the following will give you the string you want:
get-date -Uformat "%Y-%m-%d"
Keith
Hi JMiller,
We appreciate you being part of the community. We would love to help you on your query about creating filename using DATE command. However, the query's complexity is out of the community scope of support. We highly recommend that you post your query on Social Technet, where in the said forum site, our programmers, code specialists and IT professionals share their great ideas to anyone who would ask.
Should there be more that you would want to share to the community about product related ideas and concerns, please feel free to generate new post.
Kind regards.