peterjc Posted April 17, 2008 Share Posted April 17, 2008 Hai, how to get the date of six month ago from today date? Thank you. Link to comment https://forums.phpfreaks.com/topic/101535-php-get-the-date-of-six-month-ago/ Share on other sites More sharing options...
kenrbnsn Posted April 17, 2008 Share Posted April 17, 2008 I would use the strtotime() function combined with the date() function: <?php echo 'Today: ' . date('Y-m-d') . '<br>'; echo 'Six months ago: ' . date('Y-m-d',strtotime('-6 months'));?> ?> Ken Link to comment https://forums.phpfreaks.com/topic/101535-php-get-the-date-of-six-month-ago/#findComment-519339 Share on other sites More sharing options...
peterjc Posted April 17, 2008 Author Share Posted April 17, 2008 Thank kenrbnsn. Link to comment https://forums.phpfreaks.com/topic/101535-php-get-the-date-of-six-month-ago/#findComment-519393 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.