Implementation code of date and time reference under Dos
This article mainly explains "the implementation code of date and time reference under Dos". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "the implementation code quoted by date and time under Dos"!
%date% Output is: Week * yy/mm/dd (e.g. Thursday 2008/12/18)
Quotation format: %date:~x,y%
x= start coordinate, y= number of truncated characters (coordinates from 0 to 13)
For example:
%date:~4,4% -->yyyy
%date:~9,2% -->mm
%date:~12,2% --dd
For example, take out the date in YMMDD format: %date:~4,4%%date:~9,2%%date:~12,2% -->20081218
%time% Output is hh34:mi: ss.ms (e.g. 10:49:12.17)
Reference format: %time:~x,y%
x= start coordinate, y= number of truncated characters (coordinates from 0 to 12)
For example:
%time:~0,2% -->hh
%time:~3,2% -->mi
%time:~6,2% -->ss
For example, the date in YMMDD format is taken out: %time:~0,2%%time:~3,2%%time:~6,2% -->104912
Output formatted datetime: %date:~4,4%%date:~9,2%%date:~12,2%%time:~0,2%%time:~3,2%%time:~6,2% -->20081218104912
At this point, I believe that everyone has a deeper understanding of the "implementation code referenced by date and time under Dos". Let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!