11-14-2012
You might find this useful. I use it to validate input dates, first convert the date to the number of days since Jan 1 1900, then convert that number back to a date, and compare with input.
https://www.unix.com/302458026-post1.html
This User Gave Thanks to jgt For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. Programming
Hi ,
I am working at Unix system,using c lang.
I need c fun which return the day of the week .
For example :
0- Sunday.
1- Monday.
....
10x. (4 Replies)
Discussion started by: kamil
4 Replies
3. Shell Programming and Scripting
I need o get yesterday's day of week but im not exactly sure. the actual name is what i want. I can do it with numbers but im not sure with words. (3 Replies)
Discussion started by: rcunn87
3 Replies
4. UNIX for Dummies Questions & Answers
How to find the Day of the Week of the given Date using perl?
If I have a date in YYY--MM-DD format, how to find the DOW? Based on that, I need to find the following sunday.
Pls help. (5 Replies)
Discussion started by: deepakwins
5 Replies
5. HP-UX
Hi All,
I have date in string format 'YYYY-MM-DD'. I want to know day of the week for this date.
Example. For '2005-08-21' my script should return '0' or Sunday
For '2005-08-22' it should return '1' or Monday
I want piece of code for HP-UX korn shell.
Appreciate reply on this. (5 Replies)
Discussion started by: vpapaiya
5 Replies
6. UNIX and Linux Applications
Hi All,
I want to find a day of week for the Linux system.
can some one help me on this..
Thanks in advance,
Raji. (2 Replies)
Discussion started by: rajinavaneethan
2 Replies
7. Shell Programming and Scripting
Hi all, I am trying to get dow from cal using below script
#! /bin/bash
YEAR=`echo $1 | cut -c 1-4`
MONTH=`echo $1 | cut -c 5-6`
DAY=`echo $1 | cut -c 7-8`
for i in 1 2 3 4 5 6 7
do
dayofweek=`cal $MONTH $YEAR | awk '$i == $DAY {printf("%s","$i")}'`
echo $dayofweek... (4 Replies)
Discussion started by: bzylg
4 Replies
8. UNIX for Dummies Questions & Answers
I have been volunteered by my boss to be the sysadmin for our production redhat server. He asked me to tighten the security to avoid mishaps like "rm -f *" that occured not long ago.
Right now, we have 53 users sudo-ing into the machine and it is an audit nightmare. I am wondering if it... (15 Replies)
Discussion started by: alan
15 Replies
9. Shell Programming and Scripting
Hi everyone,
I have a shell script that merges many files down in to one, then removes unwanted lines, that part is working fine:
#!/bin/bash
FILES=/home/pi/temp/qbd/*
for f in $FILES
do
echo "Processing $f file..."
# take action on each file. $f store current file name
echo... (9 Replies)
Discussion started by: gjws
9 Replies
10. Shell Programming and Scripting
Hi All,
I have the below requirement ,
if i give the week number for ex 41 i need to get the date for Monday and thursday for this given week. my expected output is 13/10/2014 (Monday's date) and 16/10/2014 (Thursday's date)
I am using GNU LINUX .
Pls help me with your thoughts.
Thanks in... (7 Replies)
Discussion started by: mohanalakshmi
7 Replies
LEARN ABOUT SUSE
holidays
holidays(4) File Formats holidays(4)
NAME
holidays - prime/nonprime table for the accounting system
SYNOPSIS
/etc/acct/holidays
DESCRIPTION
The /etc/acct/holidays file describes which hours are considered prime time and which days are holidays. Holidays and weekends are con-
sidered non-prime time hours. /etc/acct/holidays is used by the accounting system.
All lines beginning with an "*" are comments.
The /etc/acct/holidays file consists of two sections. The first non-comment line defines the current year and the start time of prime and
non-prime time hours, in the form:
current_year prime_start non_prime_start
The remaining non-comment lines define the holidays in the form:
month/day company_holiday
Of these two fields, only the month/day is actually used by the accounting system programs.
The /etc/acct/holidays file must be updated each year.
EXAMPLES
Example 1: Example of the /etc/acct/holidays file.
The following is an example of the /etc/acct/holidays file:
* Prime/Nonprime Table for the accounting system
*
* Curr Prime Non-Prime
* Year Start Start
*
1991 0830 1800
*
* only the first column (month/day) is significant.
*
* month/day Company Holiday
*
1/1 New Years Day
5/30 Memorial Day
7/4 Indep. Day
9/5 Labor Day
11/24 Thanksgiving Day
11/25 day after Thanksgiving
12/25 Christmas
12/26 day after Christmas
SEE ALSO
acct(1M)
SunOS 5.10 28 Mar 1991 holidays(4)