After finding the cause, I found some methods for setting the time zone of PHP on the Internet:
1. Modify php. ini, find data. timezone = in php. ini, remove the; sign, and set data. timezone = "Asia/Shanghai.
2. Use the ini_set function ('date.
Use the following two examples to illustrate the importance of the official documentation instructions. One is the instructions given on MSDN, and one is the official description given by the GDIView GDI leak detection tool. With these official
In a clustered environment and multi-server applications that require log synchronization, in order to ensure normal collaboration between multiple servers, it is necessary to keep their time consistent, and manually adjust the time on multiple
This article describes how to set the Python time zone and how to query the time zone using pytz.
Concept and transformation of time zone
First, you need to know the conversion relationship between the time zones. In fact, this is very simple:
One, date typeThe date type uses the number of milliseconds since UTC (coordinated Universal time, international coordination Hour) from midnight January 1, 1970 to the date of the change.Second, create Date object
var date=new date
Concept and transformation of Time Zone
First, you need to know the Conversion Relationship Between the time zones. In fact, this is very simple: subtract the local time from the local time zone, and the rest is the Greenwich Mean Time. For example,
Hwclock:function DescriptionDisplays and sets the hardware clock.GrammarHwclock[--adjust][--debug][--directisa][--hctosys][--show][--systohc][--test][--utc][--version][--set--date= date and time;]Additional InformationThe hardware clock is the clock
Type description of the timeTimeTimeTime :日历时间。1970年1月1日0点到此时的秒数。Time acquisition functiontime_t time (time_t *t);Function Description: This function returns the number of seconds that have elapsed since January 1, 1970 00:00 00 seconds. If time_t
Date and Time object 1. IntroducedA Date object that is the object that operates on the date and time. The Date object operates on dates and times only through methods.2. Constructor 2.1 new Date (): Returns the current local date and timeParameters:
Original: JavaScript Date Object IntroductionDate and Time object 1. IntroducedA Date object that is the object that operates on the date and time. The Date object operates on dates and times only through methods.2. Constructor 2.1 new Date ():
Date and Time objects
1. Introduce
Date object that is the object of the action date and time. A Date object can operate on dates and times only through methods.
2. Constructor function
2.1 New Date (): Returns the current local date and
After you find out why, you search the web for some time zone settings for PHP:
1, modify php.ini, found in the php.ini Data.timezone = remove it before the number, and then set data.timezone = "Asia/shanghai";
2, in the program PHP 5 version of
1. New Date (DATESTR): Converts a string to a Date objectParameters:
①datestr {string}: A string that can be converted to a Date object (can be omitted); There are two main types of strings:
1) yyyy/mm/dd HH:mm:ss: If the time is omitted, the time
C language Settimeofday () function: Setting the current timestampheader file:
#include #include
To define a function:
int settimeofday (const struct Timeval *tv, const struct timezone);
Function Description:
########################## # Python Time Conversion # ##########################
--------------------------A. The type of time representation--------------------------
The time that may be involved in PY is four types of 1. Time String 2. DateTime
//-------------------------------------------------------------//
Asctime (representing time and date in string format)
#include
Defining functions
char * asctime (const struct TM * timeptr);Function description
asctime () converts the
Date and Time objects1. Introduce Date object that is the object of the action date and time. A Date object can operate on dates and times only through methods.2. Constructor function2.1 New Date (): Returns the current local date and time
Reason:
Windows and MacOSX default view of the PC's CMOS record clock is different.
Windows treats this clock as a local time, i.e. CMOS time is Beijing time.
MacOSX this clock as the Coordinated Universal Time (UTC) world Standard, which
Comparison of several types of timestamp
TIMESTAMP
The timestamp type, unlike date, is that date cannot be accurate to milliseconds, and timestamp can be accurate to milliseconds, with a millisecond of 0-9 digits and a default of 6 bits.
remark: article reproduced from: http://www.cnblogs.com/liuyou/archive/2012/07/29/2614338.html
Summary:
GMT/UTC/CST;
/etc/localtime,/usr/share/zoneinfo/* time zone file,/etc/profile plus TZ variable;
Hardware time RTC, system 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.