Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2008, 03:47 PM
Junior Member
 
Join Date: Apr 2008
Posts: 9
Default Got a negative number from file.dateLastAccessed

Code:
import SWFKit.*;

f = new File("c:\\test.txt");
d = new Date(f.dateLastAccessed);
trace(f.dateLastAccessed);
trace(d.toLocaleString());
I got result from above code:
-347827083
Sun Dec 28 07:22:52 GMT+0800 1969

why the return value of dateLastAccessed was a negative number?
Reply With Quote
  #2 (permalink)  
Old 05-19-2008, 04:17 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Got a negative number from file.dateLastAccessed

Yes, the "dataLastAccessed" property returns a 64-bit integer, but the "trace" method output any integer as 32-bit.
Reply With Quote
  #3 (permalink)  
Old 05-20-2008, 11:58 AM
Junior Member
 
Join Date: Apr 2008
Posts: 9
Default Re: Got a negative number from file.dateLastAccessed

but the last accessed date was wrong, either....
Reply With Quote
  #4 (permalink)  
Old 05-20-2008, 12:20 PM
Junior Member
 
Join Date: Apr 2008
Posts: 9
Default Re: Got a negative number from file.dateLastAccessed

I want to select those files modified in 24 hrs, how do I do ?
Reply With Quote
  #5 (permalink)  
Old 05-21-2008, 12:53 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Got a negative number from file.dateLastAccessed

It will return a correct time value, unless the file does not exist. To check if the file has been modified within 24 hrs, you can

Code:
d = new Date(f.dateLastModified);
f = new File("c:\\test.txt")
var cur = new Date();
var modifiedWithin24hrs = (cur.getTime() - d) < 24*3600000;
trace(modifiedWithin24hrs);
Reply With Quote
  #6 (permalink)  
Old 05-23-2008, 10:40 AM
Junior Member
 
Join Date: Apr 2008
Posts: 9
Default Re: Got a negative number from file.dateLastAccessed

The file was modified in "Fri May 23 09:35:45 GMT+0800 2008"

I wrote my code:

Code:
f = new File("c:\\test.txt");
d = new Date(f.dateLastModified);
trace("file: " + d.toLocaleString());
var cur = new Date();
trace("cur:" + cur.toLocaleString());
var modifiedWithin24hrs = (cur.getTime() - d) < 24*3600000;
trace("in 24 hr?" + modifiedWithin24hrs);
, and I got the result:

Code:
file: Mon Jan 5 02:29:27 GMT+0800 1970
cur:Fri May 23 09:46:40 GMT+0800 2008
in 24 hr?false
The file's Last Modified Date was wrong.
Reply With Quote
  #7 (permalink)  
Old 06-12-2008, 05:30 PM
Junior Member
 
Join Date: Apr 2008
Posts: 9
Default Re: Got a negative number from file.dateLastAccessed

Is anybody could help me ???
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:16 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.