HI All,
I want to have a bat file to Calculate the Week number for a Given Date in an Year
For example Today date is 16 the the week is 33
Iam new to Bat code . STEP by STEP would be more helpful for me
Thanks,
San
How Do we Calculate the Weeknumber for a given date in a yea
Moderator: DosItHelp
-
- Posts: 32
- Joined: 08 Jul 2011 03:38
Re: How Do we Calculate the Weeknumber for a given date in a
Have a look at the DateToWeek function on this website:
http://www.commandline.co.uk/lib/treeview/index.php
Regards
aGerman
http://www.commandline.co.uk/lib/treeview/index.php
Regards
aGerman
Re: How Do we Calculate the Weeknumber for a given date in a
Greetings San!
You're asking for a batch file solution that would better be solved
with a HLL or an Excel spreadsheet. Both would deal with 'week 33'
that you typed. Week 33 conforms to ISO 8601 Date and Time Standards
which I believe you are looking for rather than a calendar date
week of say January 2, 2011 which falls into week 52 of 2010 by ISO
standards.
The first challenge would be to get SWN (Simple Week Number) into
a variable and then proceed with some 'set /a' math to noodle
out the ISO week. Not a trivial task, but possible with WMIC
provided you have XP Pro or better.
A quick question San. I'm in the USA and the ISO week number is rarely
used. What do you need it for?
Post back if you would like to continue.
Best wishes San!
You're asking for a batch file solution that would better be solved
with a HLL or an Excel spreadsheet. Both would deal with 'week 33'
that you typed. Week 33 conforms to ISO 8601 Date and Time Standards
which I believe you are looking for rather than a calendar date
week of say January 2, 2011 which falls into week 52 of 2010 by ISO
standards.
The first challenge would be to get SWN (Simple Week Number) into
a variable and then proceed with some 'set /a' math to noodle
out the ISO week. Not a trivial task, but possible with WMIC
provided you have XP Pro or better.
A quick question San. I'm in the USA and the ISO week number is rarely
used. What do you need it for?
Post back if you would like to continue.
Best wishes San!