Hi,

Your main problem will be in storage - datetime fields are only down to the
second, so you will have to store the times as integers, and then do your
own arithmetic on them.

If you stored the time as ('unix time' * 100) + hundreths, then you could
probably still do some arithmetic using the standard functions and
'col_name/100', but that will only be accurate to a second.

Regards

Quentin

-----Original Message-----
From: Andreas Karl Wittwer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 6 March 2001 2:54 p.m.
To: [EMAIL PROTECTED]
Subject: Date/Time difference


Hello,

I'm reading this list for some time and checked the FAQ, archive
but i haven't found any hints ...

I have an own written app which is using a 'kind of database' to
calculate the difference between two (or more) events which can
happen between tens or hundreds of seconds.

Now i want to switch to a real database but i'm unable to
find a database function to calculate the difference between (for
example '2001-03-05- 20:09:10.54' and '2001-03-05 20:11:34.36')
of two events with a 'factional' time.

I've tried something like

INSERT INTO t_start, t_stop  VALUES
(UNIX_TIMESTAP(now() + 0.54) , UNIX_TIMESTAMP(now() + 0.38)

but this is not working for a 'DATETIME' field, a 'FLOAT' field
returns 0.

The difference between the two times is very critical because the
app is written for sports events ...

Maybe someone uses MySQL within such an application and has can
provide some hints

Andreas Karl Wittwer
Phone: +49-7052-92206
FAX:   +49-7052-92208
Mobil: +49-172-542 541 4

[EMAIL PROTECTED]



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

The information contained in this email is privileged and confidential
and intended for the addressee only. If you are not the intended 
recipient, you are asked to respect that confidentiality and not 
disclose, copy or make use of its contents. If received in error 
you are asked to destroy this email and contact the sender immediately. 
Your assistance is appreciated.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to