Home » » mktime

mktime

Written By 1 on Sunday, September 30, 2012 | 8:36 AM

int mktime ([ int $hour = date("H") [, int $minute = date("i") [, int $second = date("s") [, int $month = date("n") [, int $day = date("j") [, int $year = date("Y") [, int $is_dst = -1 ]]]]]]] )

Get Unix timestamp for a date

Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer containing the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified.


<?php
// Set the default timezone to use. Available as of PHP 5.1
date_default_timezone_set('UTC');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " date("l"mktime(000712000));

// Prints something like: 2006-04-05T01:02:03+00:00
echo date('c'mktime(123452006));
?>

5.3.0 mktime() now throws E_DEPRECATED notice if the is_dst parameter is used. 5.1.0 The is_dst parameter became deprecated. Made the function return FALSE on error, instead of -1. Fixed the function to accept the year, month and day to be all passed as zero. 5.1.0 When called with no arguments, mktime() throws E_STRICT notice. Use the time() function instead. 5.1.0 Now issues the E_STRICT and E_NOTICE time zone errors.


สอน php ฟังชั่น mktime สร้างเวลา

0 Comment:

Post a Comment