Last active
January 4, 2016 20:19
-
-
Save ryansukale/8673645 to your computer and use it in GitHub Desktop.
Php Script demonstrating how to add/subtract dates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $timeInterval = 10; | |
| $timeFactor = 'seconds'; //Can be either 'days', 'hours', 'minutes' or 'seconds' | |
| $now = date("Y-m-d H:i:s"); | |
| $futureDate = date('Y-m-d H:i:s', strtotime($now. ' + '. $timeInterval .' '.$timeFactor)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment