On 3/7/07, Jones Eric R Ctr 8 AF Det 1/AFNOC <
[EMAIL PROTECTED]> wrote:
>
> Ok here's one for you. I'm unable to convert this epoch time to a
> friendly stamp because the number of seconds uses the E notation for a
> really big number.
>
> The number it's trying to convert is 1.73300575E12, passing this
> directly to Dateformat of course fails to produce the correct date :)
>
> Thoughts?
That's probably milliseconds since the epoch, which is why it's so darned
huge.
I know how to convert coldfusion dates to java epoch times
(#now().getTime()#) but I've never had to go the other direction.
CFOpenChat uses java dates like that, but I produce the timestamps in
friendly format via javascript because it's an ajax application..
ie...
function getTimestamp(dt)
{
var today=new Date(dt);
var tt = 'AM';
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
if (h > 12) { h = h - 12; tt = 'PM'; } else if (h == 0) { h = 12; }
if (m < 10) { m = '0' + '' + m; }
if (s < 10) { s = '0' + '' + s; }
// m=checkTime(m)
// s=checkTime(s)
var result=h+":"+m+' ' + tt;
return result;
}
I don't know how to convert a java date to a friendly date in coldfusion
though...
Rick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271925
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4