Emmanuel Lecharny wrote:
Andrea Francia wrote:
W.B. Garvelink wrote:
I wasn't involved in the design decision, but I would say a long is by
far the simplest, smallest in memory and most flexible way of
returning a time stamp.
I doubt it is more flexible.

Date myDate = new Date( getlastModified() );
Is not more flexible of

public interface FtpFile {
 java.util.Date getLastModified();
}

   long dateInMillis = file.getLastModified().getTime();

But with java.util.Date we can print formatted date with

   System.out.printf("%tF", file.getLastModified());

And there are many library that uses java.util.Date() and the date returned by databases are java.sql.Date (which extends java.util.Date).

Then why don't use a array of chars for representing strings?
java.util.Date is not a perfect date API, but there is not other best choiches in the standard library.
Probably the Java 7 will provide a better date API.


pretty flexible. And simple.




--
Andrea Francia
http://andreafrancia.blogspot.com/2008/07/colinux-linux-dentro-windows.html

Reply via email to