Test environment: php5.3.29
The Unix timestamp (from the Unix era (January 1 1970 00:00:00 GMT) to the number of seconds in a given time. )。 hereinafter referred to as the timestamp.
Returns a time stamp for a time.
Time ();
Gets the timestamp of the current native time.
Mktime (hours, minutes, seconds, months, days, years);
From right to left can be omitted, omitted to the parameter is replaced with the local time, such as omitted the last day and year on the application of the current time of 22nd 2016 years.
Can write two-bit or four-digit numbers in a year. Two-digit time 0-69 corresponds to the 2000-2069,70-100 corresponding to 1970-2000. Four-bit-time test valid range 1970 to 2037.
Date (' y-m-d h:i ', $time);
Takes the timestamp of parameter 2 and obtains the string in the format of parameter 1. This is my most used format: 2016-08-22 09:02
Parameter 1 supports a number of alphabetic values, such as: s (seconds with leading zeros), M (three abbreviated months), Y (two-digit year), T (the local time zone), etc. go to the manual to find out.
GETDATE ($ time stamp);
Returns a Unix timestamp as an array, the default value for the current local time, and the return value format as follows
Array ( [seconds] = [ minutes] = [ hours] = 9//24 hour 9 points [mday] = 22//Date [wday] = 6//Monday 6 [mon] = 10//October [year] [yday] = 295// No. 295 Day of the Year [weekday] = saturday//6 [month] = october//October [0] = 1055901520// Time stamp)
Amount That's all I'm used to.
Time functions commonly used in PHP