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 this

<cfset epochToDateTime = dateAdd('s',beginTime,'01/01/1970 00:00:00.000')>

which will return

{ts '2004-03-24 12:35:02'}

and you can dress that up with...

dateFormat() as you know im sure.

tony

-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 12: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 in the future....to get seconds in between two events...

if you need more code to look @ 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/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 suffice. But I was leery of doing
things like, INSERTing 27 hours, or 35.5 hours and whatnot.

So you store larger times, say 26.5 hours, in a date time object, then you
can output, say, "1 day, 2.5 hours"? etc? Is the cfoutput merely a date/time
formatting issue?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to