Search code examples
phpfunctiontimereversemktime

how to reverse mktime() function in PHP?


I am using following to convert time to integer

mktime(hour,minute,second,month,day,year)

How would I reverse this to get desired Date? Currently I do not need Minutes or Seconds so I am using Zeroes '0' for them. Any suggestions would be appreciated.

Thanks.


Solution

  • Use the function date()

    $yourtime = mktime(...);
    date("d/m/Y h", $yourtime);