Java Core Technology Volume One note six date class

Source: Internet
Author: User

Tag: Util indicates date () Date class specifies date standard int ring

In the Java core Technology volume, the first date class appears in a very high frequency, so we have a small integration of the date class

The date class has two

The date class represents a specific time class

This constructor assigns a Date object and initializes it to represent the specified number of milliseconds because it is called the "era", which is the standard time of January 1, 1970 00:00:00 GMT.

It's like Greenwich Mean. As a benchmark value exists

Commonly used is date to string type

String s=new Date (0). toString ();
System.out.println (S.tostring ());

Two different date classes use the same method to have different values

If you use Util. The result of a Date;

Thu Jan 08:00:00 CST 1970

If you use SQL. The result of a Date;

1970-01-01

Output the current time (note that the output is now only available in Util.   Date; Sql. Date; This output format is not supported)

System.out.println (New Date ());

Java Core Technology Volume One note six date class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.