PHP mktime() ফাংশন

উদাহরণ

একটি তারিখের UNIX টাইমস্ট্যাপ ফিরিয়ে দিন:

<?php
// Output: October 3, 1975 was on a Friday
echo "Oct 3, 1975 was on a ".date("l", mktime(0,0,0,10,3,1975));
?>

Run Example

Definition and Usage

The gmmktime() function returns the UNIX timestamp of the date.

Tip:This function is similar to gmmktime() The same, but the parameters passed represent the date (not the GMT date).

Syntax

mktime(hour,minute,second,month,day,year,is_dst);
Parameter Description
hour Optional. Specifies the hour.
minute Optional. Specifies the minute.
second Optional. Specifies the second.
month Optional. Specifies the month.
day Optional. Specifies the day.
year Optional. Specifies the year.
is_dst

Optional. If the time is during Daylight Saving Time (DST), set to 1, otherwise set to 0, if unknown set to -1 (default).

If unknown, PHP will search itself (which may produce unexpected results).

Note:This parameter was deprecated in PHP 5.1.0. Instead, the new timezone handling feature is used.

Technical Details

Return Value: Returns an integer Unix timestamp, or FALSE if an error occurs.
PHP Version: 4+
Update Log:

PHP 5.3.0: If using is_dst Parameter, then throw an E_DEPRECATED.

PHP 5.1.0: The is_dst parameter has been deprecated. If mktime() is called without arguments, it will throw an E_STRICT notice. Please use the time() function instead.