Skip to content

Instantly share code, notes, and snippets.

@jcefoli
Created February 18, 2015 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcefoli/be7cff310e8164eedf5e to your computer and use it in GitHub Desktop.
Save jcefoli/be7cff310e8164eedf5e to your computer and use it in GitHub Desktop.
Set Date/Timestamp in Batch File Via Powershell
@ECHO OFF
for /f "usebackq" %%x in (`powershell "get-date -f yyyy-MM-dd_HH:mm:ss"`) do set datetimestamp=%%x
echo %datetimestamp%
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment