How do I determine week number in a month?
Posted on 2007-11-19
I have a batch job that I am writing that is scheduled to be run every Tuesday throughout the year.
I have a huge file that I am ftp'ing to another machine but I am dividing it up into 4 files.
The first Tuesday of the month will write all of the data to these four files and ftp the first file to
the other machine.The second, third, and fourth(last) Tuesday of the month will ftp the other files.
Now I need to determine what Tuesday in the month I am in. So if it is the first Tuesday of the month, I need it to do some calculation and if it is the 2nd, 3rd, 4th Tuesday then my job will do something else. I know there are circumstances where there are 5 Tuesdays in a month but I need to ignore that in my code. Can someone provide me with the code or ideas to do this?
Thanks in advance!