As per Martin's suggestion:
As per Martin's suggestion:

Added new function: get_user_timezone($timezone = 99) which retrieves
the user's timezone, respecting the $USER->timezone and $CFG->timezone
settings.

Modified all date/time library functions to use this.

dilawar/moodle