01-24-2020
Congratulations Victor and Ravinder! Well and truly earned, both of you in different, valuable ways. Thank you for your contributions!
These 6 Users Gave Thanks to Scrutinizer For This Post:
8 More Discussions You Might Find Interesting
1. What is on Your Mind?
On this special Happy News Year day, 1 January 2019, I am pleased to promote Ravinder Singh to UNIX.COM Moderator, for at least the following reasons:
Ravinder Loves UNIX.COM
Ravinder has 1,372 Thanks, which puts him in the Top Ten in that important single category.
Ravinder is one of... (8 Replies)
Discussion started by: Neo
8 Replies
2. What is on Your Mind?
Congrats to Ravinder Singh for his new Green Web Dev Ops badge.
Everyone starts to learn and grown in technology and Ravinder is starting to learn Web Dev and is making progress quickly.
https://www.unix.com/members/1-albums215-picture1010.png (6 Replies)
Discussion started by: Neo
6 Replies
3. What is on Your Mind?
This is mainly for Corona688, today's date 18-09-2019.
Remember from little acorns big trees grow a few months ago?
Well this is well on the way to 1000+ dls by the end of the year...
AMINET from its inception in 1992 is accessed by very, very many and the AMIGA is still loved by millions.
... (1 Reply)
Discussion started by: wisecracker
1 Replies
4. What is on Your Mind?
Dear All,
I am pleased to post that I am announcing a new award, "Poster of the Year 2019" and calling for your nominations (privately to me).
This is a new award and I plan to announce the winner for this year (2019) in January 2020. The prizes will be (still working out the details):
... (0 Replies)
Discussion started by: Neo
0 Replies
5. What is on Your Mind?
Here is a quick EOY report for 2019.
2019 has been a year of "downward trend reversal" for UNIX.com. In fact, if we compare total Google search impressions from the peak days in December 2019 to the peak days in mid December 2018, traffic is up 43% percent. That is a very respectable growth... (0 Replies)
Discussion started by: Neo
0 Replies
6. What is on Your Mind?
Dear All,
We are happy to post that I will be announcing soon my award for "Moderator of the Year 2019". This is a new award which I plan to announce in December of each year, starting this year (2019). The prizes will be (still working out the details):
A Moderator of the Year... (3 Replies)
Discussion started by: Neo
3 Replies
7. What is on Your Mind?
Today, I am very pleased to announce the Poster of the Year Award, 2019 is Jeroen van Dijke (Scrutinizer)
Jeroen has been a member of unix.com just over 11 years (He first joined unix.com in November 2008) and has been a very valuable, reliable and thoughtful resource for countless people over... (3 Replies)
Discussion started by: Neo
3 Replies
8. What is on Your Mind?
You are seeing this new video here first!
Top Five Cybersecurity Threats | Earth Year 2019 | You Have Been Warned!
https://youtu.be/dRE4u9QVsSg
PS: That video has two small typos, but nothing serious. Heck it took nearly 1.5 hours to render even on a 12-core Mac Pro with 64GB of... (20 Replies)
Discussion started by: Neo
20 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 year
SYNOPSIS
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)