Hi All,
I have to kick off a script on every Monday to get some data from database for last week (Sunday thru Saturday).
If its Monday (12/12/2005)
Begin date will be Sunday - 12/4/2005
End date will be Saturday - 12/10/2005
The script might not kick off on some Mondays.
So my... (2 Replies)
Hi ,
I have a date parameter passed in YYYYMMDD format , how can I check whether it is Sat or Sun on Solaris box , as we can do the same easily on linux box by using date -d YYYYMMDD '+a' .
Any pointres will be really helpful . (5 Replies)
Hello, guys !
I tried to compile PHP on one of my servers (LAMP). Everything worked fine only that I tried to set my march to pentium4 and it did not accepted it. It told me that it is a x86_64 architecture and pentium4 is not supported (I don't remember the exact error, but this was the ideea).... (2 Replies)
I was to schedule a script in a crontab after every 15 days specically on every 2nd Sunday.
I know that i can schedule on basis of weekdays, but can it be done by skipping in between???:wall: (5 Replies)
Hi again,
I need to delete stats on every 2nd Sunday and I've try the following codes but unfortunately it didn't work. I'll really appreciate as always for your help. I'm on FreeBSD 8.2-STABLE.
altsun.sh script:
#!/bin/sh
day = $(`date '+%e'`)
if then
rm... (9 Replies)
Hi Am using Unix Ksh
I have a two date input as
DATE1=02/12/2012
DATE2=30/12/2012
I Need the output as only sunday date
02/12/2012
09/12/2012
16/12/2012
23/12/2012
30/12/2012
can anyone pls help me..
thanks in advance... (2 Replies)
Hi Am using unix Ksh
I have the two dates
DATE1=01/01/2013
DATE2=11/02/2013
In this two dates i need the output as count of sunday
sunday=6
Can anyone help me pls!!! (1 Reply)
Hi,
Please can someone help me in getting first sunday date of a month.
i_year=`date +%Y`
ny_first_sun_nov=`cal 10 $i_year | sed '/^$/d' |head -3 |tail -1| rev | cut -c1`
This works good if the first sunday has a value but not if it is blank and first sunday falls on second week.
... (17 Replies)
Hi All,
Can you please let me know how to get the yesterday's date of the given date if the given date is Sunday?
I can't use GNU. I have the code to get the yesterday's date based on the system date.
Thanks (5 Replies)
Discussion started by: shash
5 Replies
LEARN ABOUT PHP
easter_days
EASTER_DAYS(3) 1 EASTER_DAYS(3)easter_days - Get number of days after March 21 on which Easter falls for a given yearSYNOPSIS
int easter_days ([int $year = date("Y")], [int $method = CAL_EASTER_DEFAULT])
DESCRIPTION
Returns the number of days after March 21 on which Easter falls for a given year. If no year is specified, the current year is assumed.
This function can be used instead of easter_date(3) to calculate Easter for years which fall outside the range of Unix timestamps (i.e.
before 1970 or after 2037).
The date of Easter Day was defined by the Council of Nicaea in AD325 as the Sunday after the first full moon which falls on or after the
Spring Equinox. The Equinox is assumed to always fall on 21st March, so the calculation reduces to determining the date of the full moon
and the date of the following Sunday. The algorithm used here was introduced around the year 532 by Dionysius Exiguus. Under the Julian
Calendar (for years before 1753) a simple 19-year cycle is used to track the phases of the Moon. Under the Gregorian Calendar (for years
after 1753 - devised by Clavius and Lilius, and introduced by Pope Gregory XIII in October 1582, and into Britain and its then colonies in
September 1752) two correction factors are added to make the cycle more accurate.
PARAMETERS
o $year
- The year as a positive number. If omitted, defaults to the current year according to the local time.
o $method
- Allows Easter dates to be calculated based on the Gregorian calendar during the years 1582 - 1752 when set to CAL_EASTER_ROMAN.
See the calendar constants for more valid constants.
RETURN VALUES
The number of days after March 21st that the Easter Sunday is in the given $year.
EXAMPLES
Example #1
easter_days(3) example
<?php
echo easter_days(1999); // 14, i.e. April 4
echo easter_days(1492); // 32, i.e. April 22
echo easter_days(1913); // 2, i.e. March 23
?>
SEE ALSO easter_date(3).
PHP Documentation Group EASTER_DAYS(3)