Quote:

I have a field in my database called "StartDate" and is formatted YYYY-MM-DD.


Yeah. Ugh.

That's how MythTV also stores dates in mySQL, as strings that look like YYYY-MM-DD. Which of course means it's all in "localtime", rather than "utctime".

Just storing the raw result of time() (number of seconds, UTC, since the epoch), is a wayyy better way to do stuff like that. Especially on POSIX systems.

I had to write a small external C routine to convert the YYYY-MM-DD string to seconds (actually, it just uses strptime()), and then just compare with (time() + 5 * 24 * 3600) to check for 5-days into the future.

But I know next to nothing about SQL, so..

Cheers


Edited by mlord (08/02/2007 19:11)