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 PHP
cal_to_jd
CAL_TO_JD(3) 1 CAL_TO_JD(3)
cal_to_jd - Converts from a supported calendar to Julian Day Count
SYNOPSIS
int cal_to_jd (int $calendar, int $month, int $day, int $year)
DESCRIPTION
cal_to_jd(3) calculates the Julian day count for a date in the specified $calendar. Supported $calendars are CAL_GREGORIAN, CAL_JULIAN,
CAL_JEWISH and CAL_FRENCH.
PARAMETERS
o $calendar
- Calendar to convert from, one of CAL_GREGORIAN, CAL_JULIAN, CAL_JEWISH or CAL_FRENCH.
o $month
- The month as a number, the valid range depends on the $calendar
o $day
- The day as a number, the valid range depends on the $calendar
o $year
- The year as a number, the valid range depends on the $calendar
RETURN VALUES
A Julian Day number.
SEE ALSO
cal_from_jd(3), frenchtojd(3), gregoriantojd(3), jewishtojd(3), juliantojd(3), unixtojd(3).
PHP Documentation Group CAL_TO_JD(3)