Yea this came from the lastModified function from the java.io.file. It
is in milliseconds and like you I'm clueless how to convert. I've looked
around the net but everything talks about using seconds not
milliseconds.
A bit more poking and a flash back to 5th grade I just changed my call
to do:
Dateadd('s',thisfile.lastModified()/1000,unixEpoch)
Versus:
Dateadd('s',thisfile.lastModified(),unixEpoch)
This gives me the correct number of seconds and allows the conversion to
work the way I expected :)
At least I know if I ever need the time down to the millisecond
java.io.file has me covered :)
Thanks all!
---------------_____________________________________________________
Eric R. Jones
Senior Web Application Developer, AFNOC/NCD
Barksdale AFB, LA
DSN 781-7784
Comm (318) 456-7784
NIPRNET: [EMAIL PROTECTED]
SIPRNET: [EMAIL PROTECTED]
-----Original Message-----
From: Rick Root [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2007 3:10 PM
To: CF-Talk
Subject: Re: Java.io.file
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7.
Free Trial. http://www.adobe.com/products/coldfusion
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271926
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4