Last active
December 17, 2015 15:39
-
-
Save giseongeom/5633102 to your computer and use it in GitHub Desktop.
clipboard에 현재시간 YYYY.MM.DD-HH:MM:SS (예 2013.05.23-15:25:14) 복사
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem method A. | |
rem When %date% variable is used, the output may different according to system locale. | |
rem So use method B instead of A, because method A's not recommended. | |
rem echo %date%-%time% | tr -d \r\n| tr -d [:space:] | clip | |
rem method B. | |
rem udate.exe, tr.exe is part of GNU Win32 tools. | |
rem udate.exe (renamed from date.exe to avoid confusing with date command on Windows O/S) | |
rem YYYY.MM.DD-HH.MM.SS | |
rem for /f %%j in ('udate -d "now" +%%Y.%%m.%%d-%%H:%%M:%%S') do set DATE2=%%j | |
rem echo %DATE2% | tr -d \r\n | tr -d [:space:] | clip | |
rem YYYY.MM.DD | |
for /f %%j in ('udate -d "now" +%%Y.%%m.%%d') do set DATE2=%%j | |
echo %DATE2% | tr -d \r\n | tr -d [:space:] | clip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment