Link to home
Start Free TrialLog in
Avatar of Gary Antonellis
Gary AntonellisFlag for United States of America

asked on

DOS Bat file that calculates and formats a date

I have an application that is passed a date range to be processed.  The format must be MM/DD/YYYY_MM/DD/YYYY where the '_' separates the start and end dates.

I need the start date to be the Monday of the current week and the end date to be the Sunday 4 weeks from the current date.

For example, if the script was run on Thu 8/9/2012, I would need the string:

08/06/2012_09/02/2012

Thanks!
Avatar of Bill Prew
Bill Prew

Is the Monday of the current week always the Monday that just went by?

And for the Sunday, you say 4 weeks from the current date, but does that mean go forward 4 weeks from today (which could be a Thursday say), and then go forward to the next Sunday?

~bp
Avatar of Gary Antonellis

ASKER

yes to both questions!
SOLUTION
Avatar of John Smith
John Smith
Flag of Gibraltar image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have been too busy to try this, but in a week or two will have a chance.  Thanks for your help!