


php mktime calculates the difference between two times_PHP tutorial
Jul 20, 2016 am 11:02 AM
mktime = mktime($hours,minute,seconds,month,day,years)
$start_time = mktime(0,0,0,01,09,2010); //Start time
$end_time = mktime(0,0,0,02,09,2010); //End time
$times = $end_time-$start_time; //
How many seconds 6 is the difference between the start and the end?
$now_time = $times/(24*3600); //Get how many there are in total
The mktime() function returns the unix timestamp of a date.
The argument always represents a gmt date, so is_dst has no effect on the result.
The parameters can be left empty in order from right to left, and the empty parameters will be set to the corresponding current gmt value.
Grammar
mktime(hour,minute,second,month,day,year,is_dst) parameter description
hour optional. Specified hours.
minute is optional. Specified minutes.
second is optional. Specifies seconds.
month is optional. Specifies the numeric month.
day is optional. Specify days.
year is optional. Specified year. On some systems, legal values are between 1901 - 2038. However, this limitation no longer exists in PHP Tutorial 5.
is_dst Optional. Set to 1 if the time is during daylight saving time (dst), 0 otherwise, or -1 if unknown.
As of 5.1.0, the is_dst parameter is deprecated. Therefore the new time zone handling features should be used.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
