Not like human who knows time in seconds, minutes, hours, days, weeks, months, etc.. PHP only know time as seconds. It measures time in seconds since January 1, 1970. The time() function generates a long string of numbers representing how many seconds have passed since January 1, 1970. Once we know how time works in PHP, we can add or subtract any amount of seconds to the time function.

$thetime = date(“H:i:s”, time()-7200);

In this example, it will subtract 7200 seconds (equal to 2 hours) to a time.