aspose file tools*
The moose likes I/O and Streams and the fly likes How to get the timestamp from the File  IO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to get the timestamp from the File  IO " Watch "How to get the timestamp from the File  IO " New topic
Author

How to get the timestamp from the File IO

mahesh lala
Greenhorn

Joined: Jul 08, 2005
Posts: 16
Hello Friends ,

Using java.io.File class with the method lastModified () retrieves the last modified file in long ie milliseconds since the epoch (00:00:00 GMT, January 1, 1970) I want the time to be like the listing files of a directory in windows environment like 7/21/2005 12:17 PM . I mean to say I want to retrieve the date and time with the lastModified method of a java.io.File class..

your early response is highly appreciated and i shall be very thankful to you .

bye
Mahesh .
==============
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
To work with dates, you could use the Date class. Have you looked at the doc for Date? Then there are other classes for formatting dates for output.
Read your doc a bit. It's all there. And sometimes faster than waiting for someone else. Search sometimes will find you code.
Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get the timestamp from the File IO
 
Similar Threads
How to know when was th e file open/modified
How to get the timestamp from the File IO
Query about lastModified()
How to get the timestamp from the File IO
How to get the timestamp from the File IO