Last active
April 12, 2017 05:37
-
-
Save anovsiradj/fb8d2136b2b982efb64073dd370280b8 to your computer and use it in GitHub Desktop.
Windows: cmd-datetime to Clipboard
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
:: DateTime to Clipboard | |
:: @author anovsiradj (http://ne-a-r.blogspot.com/ncr) <anov.siradj22@gmail.com> | |
:: @created 2016-05-04 , 09:23:44 (kerja3) | |
:: Result (in clipboard) yyyymmddhhii (no ss) | |
::pustaka | |
::http://ss64.com/nt/syntax-substring.html | |
::http://stackoverflow.com/questions/2772456/string-replacement-in-batch-file/2773504#2773504 | |
::http://www.robvanderwoude.com/escapechars.php | |
::http://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line/7105690#7105690 | |
@echo off | |
set var_date=%date% | |
call set var_date_no_dash=%%var_date:-=%%%% | |
set var_time_no_ms=%time:~0,-6% | |
call set var_time_no_2dot=%%var_time_no_ms:%:=%%%% | |
echo|set /p=%var_date_no_dash%%var_time_no_2dot%|clip | |
exit | |
::pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment