China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 15:29
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to change the output format of the system time?? View 1,541 Replies 8
Original Poster Posted 2006-12-02 03:34 ·  IANA 局域网IP(Private-Use)
初级用户
★★
Credits 141
Posts 60
Joined 2006-10-28 05:54
19-year member
UID 68605
Gender Male
From 天津
Status Offline
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
Floor 2 Posted 2006-12-02 03:58 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
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 ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 3 Posted 2006-12-02 04:01 ·  IANA 局域网IP(Private-Use)
初级用户
★★
Credits 141
Posts 60
Joined 2006-10-28 05:54
19-year member
UID 68605
Gender Male
From 天津
Status Offline
Yes, can you control how it outputs?
Floor 4 Posted 2006-12-02 04:03 ·  IANA 局域网IP(Private-Use)
初级用户
★★
Credits 141
Posts 60
Joined 2006-10-28 05:54
19-year member
UID 68605
Gender Male
From 天津
Status Offline
Can it output in the format of Friday, December 1, 2006 15:30:56 no matter in which system?
Floor 5 Posted 2006-12-02 04:13 ·  IANA 局域网IP(Private-Use)
初级用户
★★
Credits 141
Posts 60
Joined 2006-10-28 05:54
19-year member
UID 68605
Gender Male
From 天津
Status Offline
Is the difference in outputs among various systems related to system settings?
Floor 6 Posted 2006-12-02 04:37 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
It is estimated that it has little to do with the system settings
Floor 7 Posted 2006-12-02 04:38 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
You can try to move the DATE.EXE and TIME.EXE from other systems to other systems for testing.
Floor 8 Posted 2006-12-02 04:45 ·  IANA 局域网IP(Private-Use)
初级用户
★★
Credits 141
Posts 60
Joined 2006-10-28 05:54
19-year member
UID 68605
Gender Male
From 天津
Status Offline
For /F "tokens=1" %%a in ('date/t') do echo ************%%a %time%
It should be the same in any system, right?
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +3 2006-12-02 22:39
Floor 9 Posted 2006-12-06 06:56 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
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~:)
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Forum Jump: