Java acquisition system time eight hours less

Source: Internet
Author: User
Java acquisition system time eight hours less

Today suddenly encountered the need to get the current time of the problem, I always cautious, first test to get the system time is correct, the results found that less than eight hours, dizzy dead, remember before the page with JavaScript to get the current time, can be correctly obtained. Then began to surf the internet, more dizzy, the answer of various, useful code way (this certainly not, because the program does not just run on their own machine), but also modify the eclipse and the Tomcat installation files, but also modify the registry, NND, I really do not know which to use, later, finally found a, Said the problem is on the JRE, I agree, a try, sure enough! The following is attached to the steps, I hope to meet the same problem with the door to take a little help (also console you see me so much wordy words)

Operation steps: MyEclipse window (Windows) →preferences (Preferences) →java→installed jres→edit button →default vm Arguments (default VM parameters) → " - Duser.timezone=asia/shanghai "→ save.

Remember that the "-" in the front of the quotation marks must not be less.

Ok!

Java acquisition system time eight hours less

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.