What is the Date class?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What is the Date class?

Rating:

The Date class encapsulates the current date and time in terms of milliseconds. Most of the methods in the Date class have been deprecated. This class is mainly used as a bridge between the Calendar class and the DateFormat class. The constructors defined in the Date class are as follows:

  • Date(): This constructor initializes the object with the current date and time.


  • Date(long milli): This constructor initializes the object with the time elapsed since midnight January 1, 1970.
Some of the important methods defined in the Date class are as follows:

  • void setTime(long milli): This method sets the time and date as specified in the arguments. The time in the argument is specified in milliseconds and represents the time elapsed from the midnight of January 1, 1970.


  • long getTime(): This method returns the number of milliseconds that have elapsed since January 1, 1970.


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.