also, I have  cfc that I made, that I can get to you, that takes seconds,
and breaks it out to a nice days/hours/min/seconds array and returns that to
ya..

let me know if you could use it.

tony

-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 1:49 PM
To: CF-Talk
Subject: RE: Quick Question, RE: Datatype and future date/time calculation

ok...

I would have these tables.

tasks
----------
id
allottedTime  (int) [keep as seconds]
status (int) (complete/not complete) (1 or 0) actualTimeSpent (int)
[seconds] (you could write total seconds here once status is changed, or
update this with new value plus old value to keep accruing) taskName
(varchar)

taskTimeSpent
--------------------
id
beginTime (int) [seconds since jan 1 1970] EndTime (int) [seconds since jan
1 1970] taskId userId

then you can do myriad calculations on this...using this, its very simple,
and probably a lot could be added, but that's how id do it off the top of my
head.

hth
tony

-----Original Message-----
From: Jeff Small [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 1:42 PM
To: CF-Talk
Subject: Re: Quick Question, RE: Datatype and future date/time calculation

> you may have posted already, but a quick run-down of the final
> application...

Oh, I'm just looking for what would be considered the "best" datatype to use
to calculate time spent doing a task. A Task, which is stored in a task
table, has a certain amount of "time" attached to it (TimeAllocated)...say
anywhere from "fifteen minutes" to "three weeks (120 hours)". Another table,
related to the task table, will track accumulated time against a particular
task ("I spent half an hour yesterday, then three hours before lunch, then
an hour after lunch, then Randy worked on it for an hour later...so the
accumulated time should at this point be five and a half hours, if I were to
sum up all of the time spent so far...the allotted time is eleven hours, so
I can quickly see that I'm currently at fifty percent").

I just want to make sure I store the times as "the correct" datatyoe that
will allow me to perform all of those calculations using CF's date/time
functions and a little basic math...then output them in the proper format
(IE "There has been 7 hours and 45 minutes/7:45/7.5 hours spent so far, and
there are 15 more hours remaining of estimated time." and the myriad of
other ways) using regular CF formatting tools.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to