![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-17 13:09 |
47,814 topics / 349,905 posts / today 2 new / 48,259 members |
| DOS疑难解答 & 问题讨论 (解答室) » (Solved) How to use a command to change the system date to tomorrow! |
| Printable Version 846 / 2 |
| Floor1 332300684 | Posted 2005-10-22 12:35 |
| 新手上路 Posts 2 Credits 4 | |
|
Respected experts:
Because of work needs. I want to use a batch file to change the system date to tomorrow. But I don't understand it, and I don't even know whether there is such a command. Please give me some guidance. My sincere thanks! [ Last edited by willsort on 2005-10-22 at 21:23 ] |
|
| Floor2 willsort | Posted 2005-10-22 14:52 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re 332300684:
At the moment I can think of three approaches: First, save the system time, then change it to 23:59, pause for one second, and then restore the system time. This method is relatively simple to implement, because it works on most system platforms, but the system time will end up 1 to 2 seconds slow because of it. Second, convert the system date into the number of days since a certain starting date, add one to the day count, and then convert it back into a system date. Methods for converting between dates and day counts have been mentioned on this forum before, but because arithmetic operations on environment variables are needed, this only applies to NT-series command-line environments. Third, directly use some third-party tools to calculate the date and then update it. The advantage is that it is simple and fast; the disadvantage is that it cannot be done as a pure batch file operation, so portability will be reduced, and compatibility may also be affected. |
|
| Floor3 332300684 | Posted 2005-10-22 15:09 |
| 新手上路 Posts 2 Credits 4 | |
|
That really woke me up, this is already enough, thanks
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |