中国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-02 16:44
48,038 topics / 350,123 posts / today 1 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to change the output format of the system time??
Printable Version  1,543 / 8
Floor1 sunyao Posted 2006-12-02 03:34
初级用户 Posts 60 Credits 141 From 天津
For example, output December 1, 2006 Friday 15:30:56
echo %date% %time%
Display the day of the week first + 2006/12/01 + 15:30:56
Floor2 redtek Posted 2006-12-02 03:58
金牌会员 Posts 1,147 Credits 2,902
I remember that for Win2000, %date% is: "Day of the week Date"
For Win2003, %date% is: "Date Day of the week"
For MS-DOS 6.22, the output of echo.|date is in English: "Day of the week Date", for example: "Tue 11-20-2006".

[ Last edited by redtek on 2006-12-1 at 03:02 PM ]
Floor3 sunyao Posted 2006-12-02 04:01
初级用户 Posts 60 Credits 141 From 天津
Yes, can you control how it outputs?
Floor4 sunyao Posted 2006-12-02 04:03
初级用户 Posts 60 Credits 141 From 天津
Can it output in the format of Friday, December 1, 2006 15:30:56 no matter in which system?
Floor5 sunyao Posted 2006-12-02 04:13
初级用户 Posts 60 Credits 141 From 天津
Is the difference in outputs among various systems related to system settings?
Floor6 a9319751 Posted 2006-12-02 04:37
中级用户 Posts 170 Credits 439
It is estimated that it has little to do with the system settings
Floor7 a9319751 Posted 2006-12-02 04:38
中级用户 Posts 170 Credits 439
You can try to move the DATE.EXE and TIME.EXE from other systems to other systems for testing.
Floor8 sunyao Posted 2006-12-02 04:45
初级用户 Posts 60 Credits 141 From 天津
For /F "tokens=1" %%a in ('date/t') do echo ************%%a %time%
It should be the same in any system, right?
Floor9 redtek Posted 2006-12-06 06:56
金牌会员 Posts 1,147 Credits 2,902
The code on floor 8 has been tested on three systems: Win2000, XP, and Win2003. The output date format remains unchanged, and it's successful~:) Give points to Brother sunyao~:) If you don't want the "day of the week" information, this is indeed the most accurate and simplest method among these 3 different systems~:)
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023