Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Implementation code of date and time reference under Dos

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report