中国DOS联盟论坛

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-26 04:17
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS批处理 & 脚本技术(批处理室) » [Help] The running result of the date command in 2K environment
Printable Version  1,639 / 5
Floor1 namejm Posted 2006-04-11 22:01
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Who has a machine with a 2K system installed? Please help run date and post the running result. Thanks a lot.
Floor2 JonePeng Posted 2006-04-11 22:06
金牌会员 Posts 1,883 Credits 4,562 From 广东广州
I have Win 2000 Pro SP4. The result is:

Tuesday 2006-04-11
Floor3 namejm Posted 2006-04-11 22:14
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Originally posted by JonePeng at 2006-4-11 22:06:
I have Win 2000 Pro SP4. The result is:

Tuesday 2006-04-11

This is a DOS batch program I wrote under XP
I want to extract the system time in the 060101 format
I don't know how to write it in 2K to achieve this effect
Can you help modify it? Thank you
@echo off
set short_time=%date:~2,2%%date:~5,2%%date:~8,2%
echo %short_time%
pause

[ Last edited by namejm on 2006-4-11 at 22:45 ]
Floor4 hxuan999 Posted 2006-11-25 06:59
中级用户 Posts 161 Credits 337
@echo off
set short_time=%date:~-8,2%%date:~-5,2%%date:~-2,2%
echo %short_time%
pause
Floor5 redtek Posted 2006-11-25 22:46
金牌会员 Posts 1,147 Credits 2,902
The file time obtained by the batch processing %~t0 parameter in Win2000 is: 06-11-19 19:35 (2-digit year representation)
The file time obtained by the batch processing %~t0 parameter in Win2003 is: 2006-11-19 19:37 (4-digit year representation)
Floor6 tianzizhi Posted 2006-11-25 23:19
高级用户 Posts 214 Credits 623
My is Windows 2003
2006-11-25 Saturday
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023