Calculating 12th working day


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Calculating 12th working day
# 1  
Old 10-25-2011
Error Calculating 12th working day

I have a business requirement in my project where I need to calculate the 12th working day of every month. Can any please tell me the solution to my problem.

Thanks in advance
# 2  
Old 10-25-2011
Counting bank holidays/public holidays?
# 3  
Old 10-25-2011
Before anybody can provide a correct solution, you need to define what the 12th working day of a month is as far as you are concerned. This can vary by business, territory and culture.
# 4  
Old 10-25-2011
just a hint for you start the implementation. A command 'cal' (stands for calendar) output looks like the following:
Code:
    October 2011
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

This should be a good start for you - good luck.
If/when you have a more specific question/issue, do come back and ask.
# 5  
Old 10-25-2011
# 6  
Old 10-25-2011
Thanks for your feedback. According to my requirement my working day includes Mon- Fri. As my script will run only on working days ie. Mon-Fri hence I need to formulate something which will calculate the 12th working day. I am not considering any official holiday while calculating.


Thanks in advance.
# 7  
Old 10-25-2011
Quote:
Originally Posted by ami_smart
Thanks for your feedback. According to my requirement my working day includes Mon- Fri. As my script will run only on working days ie. Mon-Fri hence I need to formulate something which will calculate the 12th working day. I am not considering any official holiday while calculating.


Thanks in advance.
You've already been given a starting hint. Where exactly are you stuck?
Please show the effort!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk not working for calculating no of lines with criteria

I have tar.gz file and i want to count the lines which are matching the criteria as well as which are not matching the criteria. Following is the code Output Requirement: Match the input from zcat with 26th filed having 02 value, in case it matches then print the output in a file & increase... (12 Replies)
Discussion started by: siramitsharma
12 Replies

2. Shell Programming and Scripting

Find Month first Working Day

Hi, I would like to calculate 1st working/Business day of each month. Exp: 1st -Oct-2011 is Saturday--- Non Business Day So the Next Working Day would be 3-Oct-2011 I need a shell script to calculate the month first business date. (3 Replies)
Discussion started by: koti_rama
3 Replies

3. UNIX for Dummies Questions & Answers

Running Script via Crontab on 2nd Working day each month

Hello Guys, I have a questions regarding running a shell script every second working day each month. I have no clue how solve this problem :wall:. Important is that it has to be the second working (Mo-Fr). Example: If 1st and 2nd Days of month are Sat and Sun the script must run on 4th day... (5 Replies)
Discussion started by: Hollo
5 Replies

4. Shell Programming and Scripting

How to find the first working day of month ?

Hi, How to find the first working day of month ? My requirement is, I need to call the function only if today is first working day of month. I could find out one function which finds last working day in month in this forum. Can anyone pls let me know for first working day. Thanks. for... (10 Replies)
Discussion started by: vnimavat
10 Replies

5. Programming

get next working day

i want to get next working day from give date, that is other than Saturday or Sunday. suppose given date is 26-DEC-2008 (i.e Friday) then i should get 29-DEC-2008 as next working day(i.e Monday). how code this in C. do we have any calendar API in C. please help me out. thanks and regards (10 Replies)
Discussion started by: anup13
10 Replies

6. Shell Programming and Scripting

last working day of previous month

Hi, I want a script(ksh) to see if today is the last working day(Mon-Fri) of the month. If it is the last working day I need to print current date, else I need the last working day of previous month. Thanks in advance. (1 Reply)
Discussion started by: rspk_praveen
1 Replies

7. Shell Programming and Scripting

Get Last working day of the month

Hi I need a script to get "Last working day of the month". I will pass the month and year as parameters and i need to get the last working date. Ex for June 2008 the last working day is 30th its monday. for August 2008 the last working day is 29th and it is Friday. ie the last working... (6 Replies)
Discussion started by: manmarirama
6 Replies

8. Shell Programming and Scripting

set Working day in ksh

Hello guys it´s a pleasure to type with the unix community...I´m new in shell script and I need to insert into a #!/ksh a statment that will check if a file that I´ll receive from another script is arriving in the first working day of each month: let´s say that I´ll reveive the following files... (1 Reply)
Discussion started by: Rafael.Buria
1 Replies

9. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies

10. UNIX for Dummies Questions & Answers

Calculating the day of the week

Hi all, I would like to calculate the day of the week using a supplied date. i.e. 20011012 = Day 5. Any ideas? Many thanks, ligs (4 Replies)
Discussion started by: ligs
4 Replies
Login or Register to Ask a Question