Code | Output |
date('m-d-Y',strtotime('now')) | 05-17-2024 |
date('m-d-Y',strtotime('11 July 2016')) | 07-11-2016 |
date('m-d-Y',strtotime('+1 day')) | 05-18-2024 |
date('m-d-Y',strtotime('+1 week')) | 05-24-2024 |
date('m-d-Y',strtotime('+1 month')) | 06-17-2024 |
date('m-d-Y',strtotime('+1 month 3 days')) | 06-20-2024 |
date('m-d-Y',strtotime('+2 months -1 day')) | 07-16-2024 |
date('m-d-Y',strtotime('Wednesday')) | 05-22-2024 |
date('m-d-Y',strtotime('Sunday +1 day')) | 05-20-2024 |
date('m-d-Y',strtotime('first day of this month')) | 05-01-2024 |
date('m-d-Y',strtotime('last day of this month')) | 05-31-2024 |
date('m-d-Y',strtotime('first day of next month')) | 06-01-2024 |
date('m-d-Y',strtotime('last day of next month')) | 06-30-2024 |
date('m-d-Y',strtotime('first day of previous month')) | 04-01-2024 |
date('m-d-Y',strtotime('last day of previous month')) | 04-30-2024 |
date('m-d-Y',strtotime('+5 years ')) | 05-17-2029 |
With Date & Time | |
date('m-d-Y H:i:s',strtotime('+1 hour ')) | 05-17-2024 17:28:49 |
date('m-d-Y H:i:s',strtotime('+10 minutes ')) | 05-17-2024 16:38:49 |
date('m-d-Y H:i:s',strtotime('+20 seconds ')) | 05-17-2024 16:29:09 |
date('m-d-Y',strtotime('last day of next month +1 Hour')) | 06-30-2024 : 17 |
date('m-d-Y',strtotime('first day of next month +1 Hour 20 minutes')) | 06-01-2024 : 17 : 48 : 49 |
Fixed Date | |
date('m-d-Y',strtotime('25-12-2012 +5 years ')) | 12-25-2017 |
date('m-d-Y',strtotime('25-12-2012 +1 month 1 week ')) | 02-01-2013 |
date('m-d-Y',strtotime('12-06-2018 next Monday ')) | 06-18-2018 |
date('d-M-Y',strtotime('07-06-2018 next Wednesday')) | 13-Jun-2018 |