niche Posted November 12, 2009 Report Share Posted November 12, 2009 I found this script and don't understand where the argument 'next thursday' came form. I can't find it in the manual for the DateTime class. Shouldn't I be able to find it there? <?php$date = new DateTime('next Thursday');echo $date->format('l, F jS, Y');?> Thanks Link to comment Share on other sites More sharing options...
Synook Posted November 12, 2009 Report Share Posted November 12, 2009 (edited) http://www.php.net/manual/en/datetime.construct.php timeString in a format accepted by strtotime(), defaults to "now". Edited November 12, 2009 by Synook Link to comment Share on other sites More sharing options...
niche Posted November 12, 2009 Author Report Share Posted November 12, 2009 But, where's the documentation for the argument? Link to comment Share on other sites More sharing options...
Synook Posted November 12, 2009 Report Share Posted November 12, 2009 (edited) Well, it says it takes strings acceptable by strtotime(), so we could look there - http://www.php.net/manual/en/function.strtotime.php strtotime — Parse about any English textual datetime description into a Unix timestampSo, the argument accepts "about any English textual datetime description". Edited November 12, 2009 by Synook Link to comment Share on other sites More sharing options...
Ingolme Posted November 12, 2009 Report Share Posted November 12, 2009 It's a really intelligent system that knows English date representations, such as "tomorrow," "last week," and "+2 months" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now