Jump to content

PHP date help


c_pattle

Recommended Posts

See the manual for strtotime(): http://us2.php.net/manual/en/function.strtotime.php

 

Here is a quick example of how you could get the date 5 days in the future of the $date value

//Longform
$newDateTimestamp = strtotime("$date +5 days");
$newDateString = date("Y-m-d", $newDateTimestamp);

//Shortform
$newDateString = date("Y-m-d", strtotime("$date +5 days"));

Link to comment
https://forums.phpfreaks.com/topic/241420-php-date-help/#findComment-1240131
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.