gmmktime(): timestamp of GMT date and time

We can generate number of seconds measured since the Unix Epoch (January 1 1970 00:00:00 GMT) for any given Greenwich Mean Time GMT date and time by using gmmktime function of PHP. Here is the general syntax of mktime() function of PHP.
gmmktime (hour, minute, second, month, day, year)
Output is timestamp
This function is same as mktime() except the passed parameters represents a GMT date.

Difference in output of mktime() and gmmktime()

echo " mktime(): $d1 <br> gmmktime() : $d2 <br> Difference : $d3";
Output is here
mktime(): 1482170815 
gmmktime() : 1482190615 
Difference : 19800

Other ways to get Unix Timestamp

Function Description
strtotime()Text string of data to timestamp
gettimestamp()Getting Timestamp from date object

PHP Date Functions GMT/UTC date/time Date formats for Date()
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer