Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@anovsiradj
Last active April 12, 2017 05:37
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 anovsiradj/fb8d2136b2b982efb64073dd370280b8 to your computer and use it in GitHub Desktop.
Save anovsiradj/fb8d2136b2b982efb64073dd370280b8 to your computer and use it in GitHub Desktop.
Windows: cmd-datetime to Clipboard
:: 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