RE: [PHP] Help with Date
| From: | Ford, Mike [LSS] | Date: | Mon, 21 Jul 2003 13:41:20 +0000 |
| Subject: | RE: [PHP] Help with Date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-156068@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Elliot Tobin [mailto:elliot_tobin@yahoo.com]
> Sent: 21 July 2003 14:08
>
>
> I need a function to create the dates of previous Fridays, in
> 21-JUL-2003 format.
>
> I figure this has already been done, so I wanted to ask before I
> continued writing my own.
Take a look at strtotime() -- http://www.php.net/strtotime
Some combination of words using the word 'Friday' should get you what you want -- try
something like strtotime('last Friday') ('-2 Friday', '-3 Friday',
etc.,) to see if it does what you want; if not, you may need something like 'last week
Friday', '-2 weeks Friday', etc., or some other more complex combination.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211