• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get file created time

 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

get
t1=0
It's strange.
if I define t1 as a Date format, I get
Wed Dec 31 19:00:00 EST 1969
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the API, lastModified() returns a long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist or if an I/O error occurs.
 
Rob Spoor
Sheriff
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the file exist? My guess is no.

Non-existent files have no modification date and no size (length).
[ September 26, 2007: Message edited by: Rob Prime ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic