Re: making my own week? :)
| From: | Ignatius Reilly | Date: | Wed, 15 Jan 2003 11:02:45 +0000 |
| Subject: | Re: making my own week? :) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24850@lists.php.net to get a copy of this message | ||
The simplest seems to store the date normally in the DB.
When you need your special "Cinema" date, just do a modulo 7:
myDayOfWeek = ( WEEKDAY( '2003-01-17' ) + 3 ) % 7
HTH
Ignatius
____________________________________________
----- Original Message -----
From: "Matthew Nock" <matthew@mnc.com.au>
To: <php-db@lists.php.net>
Sent: Wednesday, January 15, 2003 11:45 AM
Subject: [PHP-DB] making my own week? :)
Hi All,
I am currently building a website for a cinema - and a cinema week runs from
Thursday, to Wednesday.
I need some help with how to get PHP to work with one week periods, but
having the week starting on a Thursday, instead of Sunday, or Monday.
The "week" will be used to generate dynamic list boxes, and database
queries...
Anyone done anything like this before that may be able to shed a little
light?
If anyone is experienced with this sort of "date manipulation" let me know
what info you need and I will provide it where possible.
Cheers,
Matt