Re: A problem with dates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Goodchild wrote:

> Hi all. I have an online events directory and am having some issues with
> date calculations. I have a table of dates (next year) and an events table
> - which have a many to many relationship and so use an intermediary
> mapping table called dates_events. All good - when the user enters a
> single, multi-day, daily or monthly event the event is entered into its
> table and some calculations done to enter values in the mapping table.
> When I perform a search all the events fall on their specified dates.
> 
> Apart from weekly events that is. When a user enters a weekly event, the
> system looks at the start and end dates, finds out the ids of all the
> dates in the date table in increments of 7, and adds the mappings.
> 
> When the weekly events are viewed, every 4 weeks they shift forward by one
> day over the week. There is some kind of ominous pattern here, but the
> maths is very simple (increment by 7) and so i thought I'd see if anyone
> can spot this right away before I dedicate my weekend to poring through
> PHP and mySQL date maths.
> 
> Thanks in advance!
> 

Have you checked that daylight saving times changes don't interfere with
your calculations?



Cheers
-- 
David Robley

It's not the principle of the thing, it's the money
Today is Setting Orange, the 3rd day of The Aftermath in the YOLD 3172. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux