Posted by Michael Fesser on 06/14/07 21:23
..oO(howzit)
>I don't want to edit my SELECT statement - as his answer would
>suggest.
Why not? That would be the easiest and most reliable way.
>I need the SELECT statement to stay as it is.
Whenever possible you should let the database do all the dirty work.
It's very good at handling things like date calculations and does it
much more efficient than PHP.
>I was hoping
>for a function that would manipulate the one instance that I am
>needing.
In PHP you would have to turn the date into a Unix timestamp (strtotime)
and calculate the difference to the current date. Two things might
become an issue in some situations:
* daylight saving time
* Unix timestamp restrictions (1970-2038 on many systems)
There's also a calendar extension in PHP for doing Gregorian and Julian
date calculations, but this is not always available.
So, as said, let the DB do it if possible.
Micha
Navigation:
[Reply to this message]
|