How do I extract the date information (using a DOS sentence) of a file in DOS??
I need to use that command in a .bat file and compare to today
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Windows » Windows – other » MS-DOS
Hello! I’ve just been pointed at your post!
Do you really mean MS-DOS, if so, which version?
Or do you mean the Command Prompt window of something like XP?
The answer would depend on which version you have, since the newer versions have more power to do what you want.
Let me know, and I’ll have a bash…
John
Hello! I’ve just been pointed at your post!
Do you really mean MS-DOS, if so, which version?
Or do you mean the Command Prompt window of something like XP?
The answer would depend on which version you have, since the newer versions have more power to do what you want.
Let me know, and I’ll have a bash…
John
Legare
If the OP has Windows XP your BATch file could be optimised significantly!
I’ll wait for a response…
John
PS There are also the usual problems with the format of dates, dependent on the Regional/International Settings. Many of these BATch files blithely assume that the whole universe works with mm/dd/yy format!
I’ve got to admit that I’ve never understood why all countries that I know of use the ‘proper’ format for time (hr mn sc) but not for dates.
By the way, I prefer to avoid the numeric representation of months when dealing with people. I haven’t encountered a lot of confusion over which month is meant, but whenever I have encountered it it’s always been due to the use of numbers. I have yet to encounter someone (English-speaking) who doesn’t understand what month I mean, without even thinking about it, when I say ‘September’.
We’re in deep water even with time, because there is the 24-hour “military” time vs. the 12 hour AM/PM version, plus innumerable variations of whether hours are always two digits, or don’t have leading zeros, and so forth.
I spent a couple of happy days documenting all the forms of date and time for the 90-odd regional settings in NT4, W2K and WXP — and if you’re not careful I’ll tell you all the details!!
John
We’re in deep water even with time, because there is the 24-hour “military” time vs. the 12 hour AM/PM version, plus innumerable variations of whether hours are always two digits, or don’t have leading zeros, and so forth.
I spent a couple of happy days documenting all the forms of date and time for the 90-odd regional settings in NT4, W2K and WXP — and if you’re not careful I’ll tell you all the details!!
John
I’ve got to admit that I’ve never understood why all countries that I know of use the ‘proper’ format for time (hr mn sc) but not for dates.
By the way, I prefer to avoid the numeric representation of months when dealing with people. I haven’t encountered a lot of confusion over which month is meant, but whenever I have encountered it it’s always been due to the use of numbers. I have yet to encounter someone (English-speaking) who doesn’t understand what month I mean, without even thinking about it, when I say ‘September’.
Legare
If the OP has Windows XP your BATch file could be optimised significantly!
I’ll wait for a response…
John
PS There are also the usual problems with the format of dates, dependent on the Regional/International Settings. Many of these BATch files blithely assume that the whole universe works with mm/dd/yy format!
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.