• Post Reply Bookmark Topic Watch Topic
  • New Topic

lastModified return  RSS feed

 
Dalibor Toth
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What actually lastModified method returns? I got some number that apparently has nothing to do with what is displayed in Windows Explorer. If I need to parse or convert the result some how, how do I do that?
Many thanks!
Bye!
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It returns a long, you can use that value to create a Date object that will tell you the actual date it was last modified.
 
Dalibor Toth
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that number "epoch seconds"?
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, sounds about right. From January 1, 1970. Date has a constructor that takes a long, you pass that value to it, call toString(), will show you a date in the form of dow mon dd hh:mm:ss zzz yyyy (day of week, month, day of month, hours, minutes, seconds, timezone, year).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!