Re: Modify MySQL time column values



"Ridge Burner" <nospam@xxxxxxxxxx> wrote in message
news:OOKdnQfSFc2OVT_ZnZ2dnUVZ_sWdnZ2d@xxxxxxxxxxxxxxxx

I think data should be stored in a column that is designed to hold that type

You are exactly right.

I created a table with a column type of 'time'. The default format for this column is =>
00:00:00 (HH:MM:SS). The form I made to populate the table has the time in this format
=> 00:00 (MM:SS), without the hours explicitly specified. So when I intended to store
something like 3:49 (3 minutes forty-nine seconds), it actually stores it as 03:49:00 (3
hours forty-nine minutes)!

You realize TIME is not a timer-type field, right? As in, even if it stored 03:49, it is
referring to 3:49 AM, *not* 3 minutes and 49 seconds.

The only thing I can think of offhand would be for you to use an INT, with a length of 4.
*IF* you know it is always going to be 4 numbers, of course. Then, you can simply split
them in half, insert a colon and go.

Or, you could simply change the form to input the correct type (best move) and retrieve it
in whatever fashion you wish. I always use a full TIMESTAMP, and extract what I need.
PHP's date function is madly in love with TIMESTAMP for the record.

I thought of one last thing... in case you are timing something. On the start of your
script, record a TIMESTAMP value, then on completion (submit, whatever) use
TIMESTAMPDIFF() to compare your original timestamp to the current timestamp. Thereby,
timing. I am just grasping at straws at this point... hope I helped somewhat.

-Lost


.



Relevant Pages

  • Re: QueryPerformanceCounter() on multiprocessor???
    ... change the APIs timer precision, ... If the system doesn't have any high precision timing sources other than ... CPU calls the timing API. ... to read the timestamp, it might be either moved to the timig-CPU, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Java MIDI message problem
    ... Java Sound Programmers Guide suggests to put -1 as the ... timestamp is you dont care about timing. ... "You can use -1 for the timeStamp argument to indicate that you don't ...
    (comp.music.midi)