Date date = new Date (); SYSTEM.OUT.PRINTLN (date);We will print out the Thu 18:05:49 CST format string in the consoleThe following code can be implemented to convert the time string in the CST format of Java into a Date object and the required
Problem description
Today, I encountered a strange problem. on the server side, the current time obtained through Java is Fri Aug 28 09:37:46 CST 2009, which is converted to GMT at: 28 Aug 2009 01:37:46 GMT, that is to say, the GMT time plus 8
Java converts the CST time string to the required date format string
The following code enables the conversion of the Java CST format time string into a Date object and the required datetime format.
String datestr = "Wed Sep 11:26:23 CST
1, the background processing method:/* Lite Resolution-Recommended */String a= "Fri Dec 00:00:00 CST 2015"; Date d = new Date (a); String f = new SimpleDateFormat ("Yyyy-mm-dd HH:mm:ss"). Format (d); System.out.println (f); /* A little copy of
Atitit. Get Beijing Time CST function API Summary O71. Get CST time ( Beijing time ) two cloth:1. Crawl URL Timtstamp >>format to the CST 1 2. Set native time setsystime : The command line that is called can only support windows Span style=
Today, a strange problem has been encountered on the server side through C # get the current time for Fri 09:37:46 CST 2009, converted toGMT time: 01:37:46 GMT, that is, GMT time plus 8 hours equals the time indicated by CST, that thisCST is not
In recent days, in doing Baidu map, you need to convert time format and do display, but found that the time format displayed, there was confusion, both the date and hours have changed. For example:
Raw time format: Thu Aug 20:38:54 CST 2016Convert
Atitit. Get Beijing Time CST function API Summary O71. Get CST time ( Beijing time ) two cloth:1. Crawl URL Timtstamp >>format to the CST 12. Set the native time setsystime(date); : Called command line, only supported for Windows and Linux Systems
DateFormat1. DateFormat IntroductionThe role of DateFormat is to format and parse the date/time. In fact, it is the date formatting tool that helps us format date and then converts date into the string string we want to useHowever, the DateFormat
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.