Date mathusing ymd to get pretty dates |
for the purposes of these calculations, 21 Dec 24 |
pretty today: Saturday, 21 December 2024 date('l, j F Y', strtotime( 2024-12-21 )) my preferred format: 21 Dec 24 date('j M y', strtotime( 2024-12-21 ) ) tomorrow: 12/22/2024 date('m/d/Y', strtotime('+1 day', strtotime( 2024-12-21 ))) next week: Saturday, December 28th, 2024 date('l, F jS, Y', strtotime('+1 week', strtotime( 2024-12-21 ))) one month ago: 21 Nov 24 date('j M y', strtotime('-1 month', strtotime( 2024-12-21 ))) complex calculations first day of next month: 2025-01-01 ( Wednesday, 1 Jan 25 ) my birthday this year: 2024-08-05 ( Monday, August 5th, 2024 ) next year: Tuesday, August 5th, 2025 days to my next birthday: 227 age today: 80.43 also on this page: function to parse dates without hypens, like 230910, into a standard yyyy-mm-dd format
|
The above codes are useful in PHP scripts to calculates dates, differences between dates, and date formats
Nimda content administration system written by Michael Potts file updated 11 September 2023 copyright © 2003-2024 Caspar Institute | |
this site generated with 100% recycled electrons |