Use datetime datatypes with datediff/dateadd functions.
-Original Message-
From: Jeff Small [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 11:58 AM
To: CF-Talk
Subject: Quick Question, RE: Datatype and future date/time calculations
Let's say a table was going to contain
Use datetime datatypes with datediff/dateadd functions.
Will date time allow me to insert dates/times that are larger than 24
hours? I mean, no harm in trying, of course...
I was actually planning on taking advantage of datediff/dateadd, that's why
I was hoping a datetime datatype would
@ this to make sense of what im trying to
explain
let me know...
tony
-Original Message-
From: Jeff Small [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 12:27 PM
To: CF-Talk
Subject: Re: Quick Question, RE: Datatype and future date/time calculation
Use datetime datatypes with datediff
:30 PM
To: CF-Talk
Subject: RE: Quick Question, RE: Datatype and future date/time calculation
use seconds in an integer field...
they are easier to work with
using epoch time (01/01/1970 00:00:00.000)
you can use that as a base, and do dateDiff's and dateAdd's using (now()) or
a date
so lets say start time was today, now().
cfset beginTime = dateDiff('s','01/01/1970 00:00:00.000',now())
that will give you a value something like this
1080131574
throw that into an integer column called beginTime
and you can translate that back to a human readable date time like
no problem...let me know.
tony
-Original Message-
From: Jeff Small [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 1:19 PM
To: CF-Talk
Subject: Re: Quick Question, RE: Datatype and future date/time calculation
so lets say start time was today, now().
cfset beginTime
use seconds in an integer field...
they are easier to work with
using epoch time (01/01/1970 00:00:00.000)
you can use that as a base, and do dateDiff's and dateAdd's using (now())
or a date in the futureto get seconds in between two events...
if you need more code to look @ this
: Datatype and future date/time calculation
use seconds in an integer field...
they are easier to work with
using epoch time (01/01/1970 00:00:00.000)
you can use that as a base, and do dateDiff's and dateAdd's using
(now()) or a date in the futureto get seconds in between two
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
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
: 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
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
- Original Message -
From: Tony Weeg [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 1:48 PM
Subject: RE: Quick Question, RE: Datatype and future date/time calculation
ok...
I would have these tables.
tasks
--
id
allottedTime(int) [keep
that up
against actualTime
make sense?
tony
-Original Message-
From: Jeff Small [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 2:16 PM
To: CF-Talk
Subject: Re: Quick Question, RE: Datatype and future date/time calculation
- Original Message -
From: Tony Weeg [EMAIL
that's fine...so don't have beginTime and endTime just have timeOnTask,
and
let them enter what they want, and translate that into seconds in the cf
code...
I use beginTime and endTime, in a web application because, I capture them
logging in, and logging out, therefore I can interpret that
Totally, you've been a terrific help. I hope this helped others as much as
it helped me.
Oh yeah, one more thing, regarding how *they've* decided *they* want the
interface, which is sort of dictating my database design...I have no problem
with it, I just want to make sure it's do-able...
Let's
: Wednesday, March 24, 2004 2:30 PM
To: CF-Talk
Subject: Re: Quick Question, RE: Datatype and future date/time calculation
Totally, you've been a terrific help. I hope this helped others as
much as it helped me.
Oh yeah, one more thing, regarding how *they've* decided *they* want the
interface
well...yeah...
select name = hours
option value=36001
option value=72002
/select
Okay, see, that was my question, how do I set the values of the hours and
minutes. Easy enough, just pass the number of seconds...gotcha...
select name = minutes
option value=601
option value=1202
/select
s'all good man, good luck, and if you need that cfc secondsToTime I can
forward that on to ya!
later.
-Original Message-
From: Jeff Small [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 2:41 PM
To: CF-Talk
Subject: Re: Quick Question, RE: Datatype and future date/time
19 matches
Mail list logo