Created
September 18, 2012 10:22
-
-
Save ryanmerritt/3742464 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
$d = new DateTime(); | |
echo $d->format("r\n"); | |
//OUT: Wed, 06 Jul 2011 17:31:13 -0400 | |
$d->setTime(0, 0, 0); | |
$mt = clone $d; | |
echo $mt->format("r\n"); | |
// OUT: Wed, 06 Jul 2011 00:00:00 -0400 | |
$my = clone $d; | |
echo $my->modify('-1 day')->format("r\n"); | |
// OUT: Tue, 05 Jul 2011 00:00:00 -0400 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment