|
Posted by Rik on 07/16/07 21:00
On Mon, 16 Jul 2007 22:52:23 +0200, Good Man <heyho@letsgo.com> wrote:
> Rik <luiheidsgoeroe@hotmail.com> wrote in
> news:op.tvkoaxivqnv3q9@metallium:
>
>> On Mon, 16 Jul 2007 20:35:11 +0200, mtuller <mituller@gmail.com>
>> wrote:
>>
>>> 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,
>>>
>>> The unix timestamp of 1183553400 is equal to Wed, Jul 04, 2007 7:50
>>> AM. I want to add the 3hrs to be able to display in this format
>>>
>>> Wed, July 04, 2007 7:50 AM - 10:50 AM.
>>>
>>
>> You made it somewhat difficult for yourself.
>> Here is how it would be done in MySQL alone (untested, fields named
>> 'date' and 'time'):
>
> whoever uses the code would probably wise to use differently named
> fields -
> 'date' and 'time', while they work, should probably be avoided.
>
> http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html
Absolutely right, allthough one get around around reserved words quite
easily, it should be more descriptive. However, the question was not how
to set up the database (which could be better) or name the fields. As I
haven't got a clue what the actual meaning of the data is, I really am not
the one to come up with alternative names :-).
--
Rik Wasmus
[Back to original message]
|