PHP | gmmktime() Function Last Updated : 31 Aug, 2018 Comments Improve Suggest changes Like Article Like Report The gmmktime() function is an inbuilt function in PHP which is used to return the Unix timestamp for a GMT date. The $hour, $minute, $second, $month, $day, $year and $is_dst are sent as parameters to the gmmktime() function and it returns an integer Unix timestamp on success or False on error. Syntax: int gmmktime( $hour, $minute, $second, $month, $day, $year, $is_dst) Parameters: This function accepts seven parameters as mentioned above and described below: $hour: It is an optional parameter which is used to specify the hour time. $minute: It is an optional parameter which is used to specify the minute. $second: It is an optional parameter which is used to specify the second. $month: It is an optional parameter which is used to specify the month. $day: It is an optional parameter which is used to specify the day. $year: It is an optional parameter which is used to specify the year. $is_dst: It is an optional parameter which can be set to 1 if the time is during daylight savings time (DST), or 0 if it is not. Return Value: This function returns an integer Unix timestamp on success or False on error. Exception: PHP 5.3.0 version throws an E_DEPRECATED error if the $is_dst parameter is used. Below program illustrate the gmmktime() function in PHP: Program 1: php <?php // Using gmmktime() function to know the day echo "August 30, 2018 was on " . date("l", gmmktime(0, 0, 0, 8, 30, 2018)); ?> Output: August 30, 2018 was on Thursday Program 2: php <?php // Using gmmktime() function to know // the complete date echo date("M-d-Y", gmmktime(0, 0, 0, 12, 1, 2012)) . "<br>"; // Using gmmktime() function to know the // complete date for an out-of-range input echo date("M-d-Y", gmmktime(0, 0, 0, 12, 20, 2017)); ?> Output: Dec-01-2012Dec-20-2017 Related Articles: PHP | mktime() Function PHP | localtime() Function PHP | date_sunset() Function Reference: http://php.net/manual/en/function.gmmktime.php Comment More infoAdvertise with us Next Article PHP | gmmktime() Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-date-time PHP-function +1 More Practice Tags : Misc Similar Reads PHP | gmstrftime() Function The gmstrftime() function is an inbuilt function in PHP which is used to format a GMT/UTC time/date according to local settings. The gmstrftime() function in PHP behaves in the same way as strftime() except that the time returned by the gmstrftime() function is Greenwich Mean Time (GMT). The $format 2 min read PHP | gmdate() Function The gmdate() is an inbuilt function in PHP which is used to format a GMT/UTC date and time and return the formatted date strings. It is similar to the date() function but it returns the time in Greenwich Mean Time (GMT). Syntax: string gmdate ( $format, $timestamp ) Parameters: The gmdate() function 2 min read PHP | gmp_nextprime() Function The gmp_nextprime() is an inbuilt function in PHP which is used to calculate the prime number just greater than a given GMP number(GNU Multiple Precision : For large numbers). Syntax: gmp_nextprime($num) Parameters: This function accepts a GMP number $num as a mandatory parameter as shown in the abo 2 min read PHP | gmp_mul() Function The gmp_mul() function in PHP is an inbuilt function which is used to multiply two GMP numbers (GNU Multiple Precision: For large numbers). Syntax: GMP gmp_mul ( GMP $num1, GMP $num2 ) Parameters: This function accepts two GMP numbers. It is mandatory parameters as shown in the above syntax. These c 1 min read PHP | gmp_neg() Function The gmp_neg() function is an in-built function in PHP which returns the negative of a GMP number (GNU Multiple Precision). Syntax : gmp_neg( $num ) Parameters : The function accepts only one mandatory parameter $num which can be either a GMP number resource in PHP 5.5 or a GMP object in PHP version 1 min read Like