Thank you Wil and CS. I was able to output the date how I want it
with...
#DateFormat(DateAdd("s", "993124800", "January 1 1970
00:00:00"),"long")#
#TimeFormat(DateAdd("h",-getTimeZoneInfo().utcHourOffset,DateAdd("s",
"993124800", "January 1 1970 00:00:00")),"long")#
Now I'll go back through it to simplify its reuse. Thanks!
-----Original Message-----
From: Wil Genovese [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2008 10:49 AM
To: cf-talk
Subject: Re: Parsing timestamp set by phpBB
If its EPOCH time then this will work. I wrote a simple function for
that
ages ago.
<cfscript>
/*######################################################################
###
# epochtime by Wil
Genovese #
# take a time format and convert either to or from
epoch #
#
#
# datetime - actual value to
convert #
# conversion - the type of conversion to
do #
# E2D for epoch to
date #
# D2E for date to
epoch #
# example
usage: #
# Convert 1162576737 to
#epochtime("1162576737","E2D","0")#<br> #
# Convert '#now()#' to
#epochtime(now(),"D2E","1")#<br> #
########################################################################
#*/
function epochtime(datetime,method) {
var epoch = "January 1 1970 00:00:00";
if (method eq "E2D"){
return Dateadd("s",datetime,epoch);
} else if (method EQ "D2E") {
return DateDiff("s",epoch,datetime);
}
}
</cfscript>
Wil Genovese
Sr. Web Application Developer
On Mon, Nov 3, 2008 at 10:37 AM, C S <[EMAIL PROTECTED]> wrote:
> >I have a date represented as "993124800" in my database that php's
> >date() function is able understand and format. I'm running into dead
> >ends trying to have ColdFusion parse this date correctly. That date
> >should work out to...
>
>
> That looks like an epoch time. Try
> http://www.cflib.org/index.cfm?event=page.udfbyid&udfid=654
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314779
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4