Skip to content

Instantly share code, notes, and snippets.

@giseongeom
Last active December 17, 2015 15:39
Show Gist options
  • Save giseongeom/5633102 to your computer and use it in GitHub Desktop.
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) 복사
@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