I learn something new every day as far as PHP is concerned.

The PHP manual clearly states how to obtain a past or future date and time using the date() and mktime() functions. What it doesn't state is how to easily convert between two different time zones. I had to figure it out on my own and guess what? It was a heck of a lot easer than I thought it would be. I didn't need any form of reference other than the PHP manual itself.

Here's the code:

$timezone = "Asia/Manila";
putenv("TZ=".$timezone);
$date = date("Ymd H:i:s", mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"), date("I")));

Before I tested this code, I did not know that putenv() would affect the remaining date and time functions in the script. It was nothing more than a lucky guess.