Get Date 24 Hours Ago In Cf

Joined: 11/28/2008

I have found that this gets me the date and time right now:

<cfset RightNow = #DateFormat("# Now()#", "yyyy-mm-dd HH:mm:ss")#>

What can I use to get the date and time 24 hours ago, that will also work even if it is 1/1/08 (to get the date and time from 12/31/08)?
It seems to be something with CreateTimeSpan but I can't quite get it down.

Thanks,
Chris

Joined: 11/28/2008
CODE #DateAdd("d", -1,
CODE
#DateAdd("d", -1, Now())#

This will return the time stamp from 24 hours ago. Just style it the way you like with DateFormat and you're in business.

Joined: 11/28/2008
Paul.Hobson @ Jan 25
QUOTE(Paul.Hobson @ Jan 25 2008, 03:53 PM)
CODE
#DateAdd("d", -1, Now())#

This will return the time stamp from 24 hours ago. Just style it the way you like with DateFormat and you're in business.

SWEET. Thanks Paul! /thumbsupsmileyanim.gif" style="vertical-align:middle" emoid=":thumbsani:" border="0" alt="thumbsupsmileyanim.gif" />

Joined: 11/28/2008
No problem!Hey MODs, the

No problem!

Hey MODs, the forum went nuts up there , i need a clean up.

*edit* 2 duplicates deleted.