The AIX date command has a feature to produce an integer for day-of-year (same as GNU/Linux date):
yielding:
This would be a constantly updated source for a sequence that could be checked for being divisible by 3. See man date for details ... cheers, drl
hello there,
i'm learning about task scheduling with cron and all seems hyper exciting, yeppie. But there is a prob:
assume i have a script that needed to be executed at 7am everyday. I could do:
vi mycron
00 7 * * * echo hi mother, i wanna be a script daddy.
:wq
crontab mycron
how... (4 Replies)
Is there a way in AIX to schedule a script to run bi-weekly through cron?
I have a script that needs to run every other Wednesday, and this is what I thought I had to enter in the crontab file:
00 08 * * 3/2 /home/user/user.script
It didn't like that. It reports a syntax error. I'm almost... (5 Replies)
I would like to setup a cron job to run a command from another directory.
What is the best way to do this?
The cron file is in a directory and the script I want it to run is in another directory.
I tried doing this in the cron file:
/location/of/command/run.sh
But that did not work.... (2 Replies)
Hello, is it possible to schedule cron jobs using business days instead of calendar days? I need to run several jobs on first and third business days of the month. I currently have this cron-tab entry which runs every week day at 5 AM. I need to schedule the same job on the 3rd Business day of the... (8 Replies)
Hi Everybody,
I want to run a script at every 5 seconds. I know how to run it every 5 minutes, is there any possibility to run a script at 5 seconds interval.
Regards,
Mastan (3 Replies)
Hi,
I created this cron job for asterisk to send sms daily to a number
#!/bin/sh
#custom mod - send sms once a day, at 07:00.
CRON_PATH="/etc/asterisk/gw/crontabs_root";
if ! grep 'gsm send sms' $CRON_PATH > /dev/null 2>&1 ;then
echo "* 7 * * * asterisk -rx 'gsm send sms 1 7666... (4 Replies)
Discussion started by: jazzyzha
4 Replies
LEARN ABOUT PHP
easter_date
EASTER_DATE(3) 1 EASTER_DATE(3)easter_date - Get Unix timestamp for midnight on Easter of a given yearSYNOPSIS
int easter_date ([int $year = date("Y")])
DESCRIPTION
Returns the Unix timestamp corresponding to midnight on Easter of the given year.
Warning
This function will generate a warning if the year is outside of the range for 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 number between 1970 an 2037. If omitted, defaults to the current year according to the local time.
RETURN VALUES
The easter date as a unix timestamp.
EXAMPLES
Example #1
easter_date(3) example
<?php
echo date("M-d-Y", easter_date(1999)); // Apr-04-1999
echo date("M-d-Y", easter_date(2000)); // Apr-23-2000
echo date("M-d-Y", easter_date(2001)); // Apr-15-2001
?>
NOTES
Note
easter_date(3) relies on your system's C library time functions, rather than using PHP's internal date and time functions. As a con-
sequence, easter_date(3) uses the TZ environment variable to determine the time zone it should operate in, rather than using PHP's
default time zone, which may result in unexpected behaviour when using this function in conjunction with other date functions in
PHP.
As a workaround, you can use the easter_days(3) with DateTime and DateInterval to calculate the start of Easter in your PHP time
zone as follows:
<?php
function get_easter_datetime($year) {
$base = new DateTime("$year-03-21");
$days = easter_days($year);
return $base->add(new DateInterval("P{$days}D"));
}
foreach (range(2012, 2015) as $year) {
printf("Easter in %d is on %s
",
$year,
get_easter_datetime($year)->format('F j'));
}
?>
The above example will output:
Easter in 2012 is on April 8
Easter in 2013 is on March 31
Easter in 2014 is on April 20
Easter in 2015 is on April 5
SEE ALSO easter_days(3) for calculating Easter before 1970 or after 2037 .
PHP Documentation Group EASTER_DATE(3)