Posted by Michael Fesser on 07/16/07 18:52
..oO(mtuller)
>I have a database that stores time in 2 different formats. I have a
>unix timestamp, and the other is a representation of time in the
>format 03:00:00 which would represent 3 hrs. I want to convert the 3
>hrs so that I can add it to the unix timestamp. In other words,
Why not simply store the date in a real DATETIME field? You can always
use UNIX_TIMESTAMP() if you need it. Then all you need would be to call
ADDTIME() to add both values.
If converting the column is not an option, use FROM_UNIXTIME() before
calling ADDTIME().
HTH
Micha
[Back to original message]
|