List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:July 5 1999 3:00pm
Subject:[Fwd: Timestamp and total time taken]
View as plain text  

Douglas Brantz wrote:

I Should specify that I am using Mysql 3-22-15 on a Redhat 5.2.

In PHP3 I would use an int for tdin and tdout and store a value from the
time() function (the number of seconds since Unix). This value can then
be used with the date() function for almost everything, as well as
getting the difference between timein and timeout; tdtotal=tdout-tdin
(in seconds, multiply as you like to get minutes and hours).

So, I could keep the cool timestamp fields for my own records but perhaps add
fields where the time would be captured by the OS with the time() funtion and
have rttotal=rtout-rtin in seconds and then divide by 60 until I get minutes
and hours?

> Trying to create a student monitor login for a lab and want to get the
> time they start and the time they end.  These two times should be used
> to get the total time spent in the lab.  Should I use Timestamp twice
> one for timein and one for timeout and if so is there a way to add up
> the time the montor worked in the lab by using the timestamp method?
> Can I simply use HH,MM from tdin to HH,MM of tdout?  Should I go about
> this a different way?  This is what I have so far for my table.  Would
> this be a perl script.?
>
> Create Table monitor (
> formnum mediumint not null auto_increment,
> firstn varchar (30),
> lastn varchar (30),
> info blob,
> tdin timestamp (14),
> tdout timestamp (14),
> tdtotal (?) This is where the total time will be stored.
> Primary Key (formnum)
> )
>
> Thanks in advance.
>
> --
>
> Douglas Brantz
> Computer Consultant
> Fine & Applied Arts
> Appalachian State University
> Boone, NC 28608
>
> 828-262-6312 FAX
> 828-262-6549 OFFICE
> brantzdr@stripped
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread6560@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.

--

Douglas Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608

828-262-6312 FAX
828-262-6549 OFFICE
brantzdr@stripped


Thread
[Fwd: Timestamp and total time taken]Douglas Brantz5 Jul