note 120254 added to datetime.formats.relative

From: Date: Thu, 01 Dec 2016 13:44:49 +0000
Subject: note 120254 added to datetime.formats.relative
Groups: php.notes 
Request: Send a blank email to php-notes+get-207850@lists.php.net to get a copy of this message
I'm not sure if this is a bug or expected. As erwin points out : "first monday of may 2011" is invalid, but "first monday may 2011" does work. Simply omit "of" if above examples do not work. This still applies in 5.5 as well, and I ran into it while building out a utility to check if a day was a holiday. Meaning "fourth day July 2016" /works/, but "fourth day of July 2016" does not. It will return an error. I emphasize works, because "fourth day July 2016" actually returns 2016-07-05. So you'll need "third day July 2016" for the Fourth of July. However, "Last Monday May 2016" and "Last Monday of May 2016" ( for Memorial Day ) are both /valid/, but produce different results. The first returns 2016-04-25, which is incorrect, while the second returns the correct 2016-05-30. ---- Server IP: 72.52.91.14 Probable Submitter: 2602:30a:c7d3:d670:1d47:84a7:6dff:4253 ---- Manual Page -- http://php.net/manual/en/datetime.formats.relative.php Edit -- https://master.php.net/note/edit/120254 Del: integrated -- https://master.php.net/note/delete/120254/integrated Del: useless -- https://master.php.net/note/delete/120254/useless Del: bad code -- https://master.php.net/note/delete/120254/bad+code Del: spam -- https://master.php.net/note/delete/120254/spam Del: non-english -- https://master.php.net/note/delete/120254/non-english Del: in docs -- https://master.php.net/note/delete/120254/in+docs Del: other reasons-- https://master.php.net/note/delete/120254 Reject -- https://master.php.net/note/reject/120254 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#207850) next »