I was born on 1986-04-21, which is Monday. My next birthday with the name of the day is Monday - 1997-04-21, etc.
I wrote a program to find up to 100 years old to find out what year my birthday goes with the corresponding day name that is on Monday.
This is the code:
<?php date_default_timezone_set('Asia/Calcutta'); for($year = 1986; $year < 2086; $year++) { $timestamp = mktime(0, 0, 0, 4, 21, $year); if(date('l', $timestamp) == 'Monday') { echo date('Ymd, l', $timestamp) . "\n"; } } ?>
This is the output of the program:
1986-04-21, Monday 1997-04-21, Monday 2003-04-21, Monday 2008-04-21, Monday 2014-04-21, Monday 2025-04-21, Monday 2031-04-21, Monday 2036-04-21, Monday
Now my problem is why PHP does not support until 1970 and after 2040.
So, how can I get a birthday after 2040 or before 1970?
source share