The function "localtime" return an array..similar to C.
Take a look here: 😉
http://www.php.net/manual/de/function.localtime.php
The mktime function calculates the timestamp in the right way.
mktime(date("H") - 5, ....)
returns your time -5 hours.
If it is 1:00 it will be the day before 21:00.
But this solution "mktime(date...)" is not very good, because you have to call date 6 times.