THE PACKAGE JAVA.UTIL
java.util.Date
21.3
Examples:
To print today s date:
System.out.println("today = " + new Date());
To find out the day of the week for some particular date, for example, January
16, 1963:
new Date(63, 0, 16).getDay()
While the
Date
 class is intended to reflect UTC (Coordinated Universal
Time), it may not do so exactly, depending on the host environment of the Java
system. Nearly all modern operating systems assume that 1 day = 24
60
60  =
86400 seconds in all cases. In UTC, however, about once every year or two there
is an extra second, called a  leap second.  The leap second is always added as the
last second of the day, and nearly always on December 31 or June 30. For exam 
ple, the last minute of the year 1995 was 61 seconds long, thanks to an added leap
second.
Most computer clocks are currently not accurate enough to be able to reflect
the leap second distinction. Some computer standards are defined in terms of
GMT (Greenwich Mean Time), which is equivalent to UT (Universal Time).
GMT is the  civil  name for the standard; UT is the  scientific  name for the same
standard. The distinction between UTC and UT is that UTC is based on an atomic
clock and UT is based on astronomical observations, which for all practical pur 
poses is an invisibly fine hair to split. Because the earth's rotation is not uni 
form it slows down and speeds up in complicated ways UT does not always
flow uniformly. Leap seconds are introduced as needed into UTC so as to keep
UTC within 0.9 seconds of UT1, which is a version of UT with certain corrections
applied. There are other time and date systems as well; for example, the time scale
used by GPS (the satellite based Global Positioning System) is synchronized to
UTC but is
not
 adjusted for leap seconds. An interesting source of further infor 
mation is the U. S. Naval Observatory, particularly the Directorate of Time at:
http://tycho.usno.navy.mil
and their definitions of  Systems of Time  at:
http://tycho.usno.navy.mil/systime.html
In all methods of class
Date
 that accept or return year, month, day of month,
hours, minutes, and seconds values, the following representations are used:
A year
y
 is represented by the integer
y
  1900 .
A month is represented by an integer form 0 to 11; 0 is January, 1 is February,
and so on; thus 11 is December.
623






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved