Linux time zone details and common time functions time and time zone The entire earth is divided into 24 time zones, each time zone has its own local time. ø UTC Time and GMT time We can think of Greenwich Mean Time (GMT = UTC), GMT and
Global 24 time Zones Division
The World Time Zone table, which can display time and place names in each of the world's time zones, is more sophisticated and complex than the two-way timetable, and usually the world time zone table's dial will mark
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
Origin of the problemTimestamp conversion (timestamp: The total number of seconds from January 1, 1970 (00:00:00) to the current time. )#include #includeintMainintargcConst Char*argv[]) {time_t T; structTM *p; T=1408413451; P=gmtime (&t); Chars[
Time zone abbreviation UTC, CST, GMT, CEST and conversionUTC is an abbreviation for Coordinated Universal Time (Universal time coordinated), which is defined and recommended by the International Radio Advisory Committee and is maintained by the
Nowadays, more and more work needs to use the time zone concepts around the world. Recently, I have seen abbreviations such as DST, EDT, PDT, wet, and CCT in my documents, which makes me dizzy. So I made a memo on the Internet:
The time zone
1. Check the system time[[Email protected] ~]# DateThu Dec 23:25:33 CST 2012[[Email protected] ~]# date + "%y%m%d%h:%m:%s"20121220 23:12:542. View hardware TimeThe system clock is the clock in the current Linux kernel, and the hardware clock is a
# Save settings$ Sudo mv/etc/localtime. old# Set the time zone $ Sudo ln-sf/usr/share/zoneinfo/Asia/Hong_Kong/etc/localtime# Changed # Update some files. This file is read by the system-config-date command. $ Sudo vim/etc/sysconfig/clock# You can
Date and Time functionsThis chapter discusses some functions that can be used to manipulate time values. See section 11.3, "Date and Time type" for valid formats for each time and date type with a range and a specified value.
The following example
Error page code: server in USA
Date_default_timezone_set ('prc'); // The time zone is set here.
$ Now_day = date ('L ');
$ Now_date = date ("Y/m/d ");
Echo "now_day =". $ now_day ."
";
Echo "now_date =". $ now_date ."
";
Echo time
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.