Avatar of NigelRocks
NigelRocks

asked on 

Formatting a Date in DOS

Experts,

I want to use a DOS batch file to launch an .exe while sending a date to it as a command-line parameter.  I first want to decrement the date so that we're using yesterday's date; then I want to send it in in YYYYMMDD format.  

How would I do this?
Microsoft DOS

Avatar of undefined
Last Comment
Qlemo
SOLUTION
Avatar of carlsiy
carlsiy
Flag of Philippines image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of carlsiy
carlsiy
Flag of Philippines image

not too shabby... but does it handle leap years?
SOLUTION
Avatar of carlsiy
carlsiy
Flag of Philippines image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Qlemo
Qlemo
Flag of Germany image

I prefer the AmazingTech stuff for sure - more elegance. And it has been testet back to start of Gregorian calender ...

Avatar of carlsiy
carlsiy
Flag of Philippines image

still... every 4 years youll get stumped in the leap year. better have a chack at that too.
Avatar of Qlemo
Qlemo
Flag of Germany image

The 4 yr and 100 yr rules are obeyed.
Microsoft DOS
Microsoft DOS

Microsoft Disk Operating System (MS-DOS) was an operating system for x86-based personal computers, and traces of it are still found in the Windows operating system. DOS is still used in some embedded systems and for certain legacy 16-bit networks.

14K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo