20145237 Java programming Seventh week of study summary

Source: Internet
Author: User
Tags date1 time zones time and date

20145237 "Java program design" The seventh Week study summary textbook Learning content Summary

The 13th Chapter One, the understanding time and the date 1. Time measurement before you formally know what time Java provides for processing the API, you have to understand some of the historical issues of time and date, so that you know that the time and date is really a complex issue, and that using the program to process the time and date,   It's not just about using the API.   A. GMT: Greenwich Mean Time is referred to as GMT, and at the beginning it is the standard solar time from the Royal Observatory of Greenwich, when the sun arrives at the highest point of the sky at Greenwich Standard Time, Greenwich Mean time is often considered as UTC time. B. World time: It is more accurate to observe the sun than by observing distant stars crossing the meridian, also known as UT.   GMT is the same as UT before UTC is introduced in 1972. C. International Atomic time: While observing a distant star is more accurate than observing the sun, UT is still largely affected by the Earth's rotational velocity and is subject to errors.   When the International Atomic Time (TAI) was defined in 1967, the International unit of the second was defined as the time spent on the radiation vibrations of cesium atoms for 9,192,631,770 weeks, and the time was synchronized from the 1958 of UT. D. World coordination time: Since the second length based on the definition of cesium atom vibration is fixed, the rotation of the earth will be slower, which will actually lead to the fact that Tai time will continue to advance based on the Earth rotation of the UT series time, in order to maintain the TAI and UT time is not too large,   Therefore, the world coordinated Time (UTC) with a compromise revision is proposed.   E.unix Time: The time representation of a UNIX system, defined as the number of seconds elapsed in UTC time January 1, 1970 00:00:00 as the starting point, regardless of the leap second correction, to express a moment on the timeline. F.epoch: The beginning of a particular era, a moment on the timeline.   For example, the time information in the Java.util.Date package is the number of milliseconds that January 1,1970,00:00:00 GMT passes, which can be referred to as the epoch millisecond. For now, even though it is GMT, the time actually referred to is UTC time. The unit definition of the second is based on the Tai, which is the number of radiation vibrations of the cesium atom. Unix time is the number of seconds elapsed from January 1, 1970 00:00:00 for the starting point, regardless of leap seconds.

2. Calendar Introduction:

• The Julian calendar, the predecessor of the current Gregorian calendar, replaces the Ides, amending the Roman calendar three years to set a leap year error, four years to change the run. • The Gregorian calendar reformed the Julian calendar, which was promulgated by Pope Pope Gregoryⅹⅲ in 1582, and the day of the Julian calendar on Thursday, October 4, 1582, is scheduled for the Gregorian calendar October 15, 1582 Friday.

3. Recognize time zones geographically, because the earth is round, basically one day on the other side is the night, in order to let people to the time of cognition in line with the rest, so set a UTC offset, roughly speaking, longitude every 15 degrees is offset one hours, considering the UTC offset time representation, usually identifies the z symbol. However, some countries have a large latitude across the territory, a country has a lot of time instead of trouble, so do not take every 15 degrees offset an hour, such as the United States only 4 time zones, and China, India only use a single quarter.   The number of milliseconds in a year is definitely not a mere 365x24x60x60x1000, let alone a time and date operation based on such erroneous notions. 13.2 recognize date and calendar instantaneous date system.currenttimemillis () on the timeline: If you want to get system time, one way is to use the System.currenttimemillis () method, Returns a long type integer representing the number of milliseconds that have elapsed since January 1, 1970 0:0 0 seconds 0 milliseconds • Someone uses a date instance to get a system time description, but date is also a time point of view for machines, for example: import java.util.*; Import static java.lang.system.*;

public class Datedemo {public static void main (string[] args) {Date date1 = new Date (Currenttimemillis ()); Date Date2 = new Date ();

Out.println (Date1.gettime ());     Out.println (Date2.gettime ()); }

Problems in teaching materials learning and the solving process

Question: How to calculate the run time of a program?

Solve:

Long Starttime=system.currenttimemillis (); Get Start time

DoSomething (); Code snippet for testing

Long Endtime=system.currenttimemillis (); Get End time

SYSTEM.OUT.PRINTLN ("program Run Time:" + (End-start) + "MS");

This week code hosting other (sentiment, thinking, etc., optional)

There were many experiments this week, most of which were spent on experimental research. But this week there is only one chapter of the study content, so the feeling is relatively easy.

Learning progress Bar

| | Lines of code (new/cumulative) | Blog volume (Add/accumulate) | Learning time (NEW/cumulative) | Important Growth | | --------   | :----------------:|:----------------:|:---------------:  |:-----:| | Target |   5000 Rows | 30 Articles |       400 hours | | | Seventh Week |   200/1230 | 2/14 | 20/110 |

20145237 Java programming Seventh week of study summary

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.