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 PHP gmp_lcm() Function The gmp_lcm() is an inbuilt function in PHP that is used to calculate the least common multiple (LCM) of two or more integers. Syntax: gmp_lcm(GMP|int|string $num1, GMP|int|string $num2): GMPParameters: This function accepts two parameters that are described below. $num1: A GMP number resource repre 1 min read PHP | imagegd() function The imagegd() function is an inbuilt function in PHP which is used to output GD image to browser or file. This is most useful to convert any other image type to gd. imagecreatefromgd() function can be used to further read gd images. Syntax: bool imagegd( resource $image, float $to) Parameters:This 2 min read PHP | gmp_import() Function The gmp_import() function is an inbuilt function in php which imports a GMP number(GNU Multiple Precision: For large numbers) from a binary string. Syntax: GMP gmp_import ( string $data, int $word_size, int $options ) Parameters: The gmp_import() function accepts three parameters as mentioned above 2 min read PHP gmp_init() Function The gmp_init() function is an inbuilt function in PHP that is used to create a GMP number from different data types, including strings, integers, or other GMP objects. It's commonly used when you want to start performing arithmetic operations on large numbers without losing precision. Syntax: gmp_in 2 min read PHP | gmp_hamdist() Function The gmp_hamdist() is a built-in function in PHP which is used to find the hamming distance between two GMP numbers (GNU Multiple Precision : For large numbers). Hamming distance between two numbers is defined as number of mis-matching bits in their binary representation. Syntax: gmp_hamdist ( $num1, 2 min read Like