Neighborhoods a long usage

Category: Web Develop
 
LIUZY10000000
2011-08-21 07:55:57

Sponsored Links
long DAY = 24L * 60L * 60L * 1000L;
SimpleDateFormat df = new SimpleDateFormat ("MM.dd.yyyy" ;);
Date d1 = df.parse ("04.30.2001");
Date d2 = df.parse ("05.01 .2001 ");
System.out.println (" The number days between: ");
System.out.println (d1) ;
System.out.println ("and:");
System.out.println (d2);
System.out.println ( ; "is:" + ((d2.getTime () - d1.getTime ()) / DAY));

This is a comparison of the number of days between two dates code, the test run is correct, but I do not understand long DAY = 24L * 60L * 60L * 1000L
meaning here, please expert guidance. Thank you, the

Sponsored Links

jmxcbbs
2011-08-21 08:12:24

That depends Long position in which

System.out.println (1000000000L * 10 * 10);
System.out. println (1000000000 * 10 * 10L);

these two results are not the same
qq543907714
2011-08-21 08:29:47
getTime () returns the number of milliseconds
lmhussydbz
2011-08-21 08:47:53
int * int = int
This is to guarantee the long type save the results, and will not be truncated
cui01130073
2011-08-21 08:57:17
main test filter to the data may be too large

int might Unable to save it with
long
zero911
2011-08-21 09:08:55
expression has a Long on the line, the operation will automatically upgrade.
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.