You're way too overcomplicating this. To convert between two timezones using DateTime
, do this:
date_default_timezone_set('Asia/Kolkata'); // YOUR timezone, of the server
$date = new DateTime($input, new DateTimeZone('Asia/Tokyo')); // USER's timezone
$date->setTimezone(new DateTimeZone('UTC'));
echo $date->format('Y-m-d H:i:s');
This converts from a user's local timezone to UTC. To go the other way around, to display the time in the user's local time, swap the two timezones.
Yes, PHP takes care of DST. The necessary conversion rules are part of the PHP installation. You can keep them up to date by updating PHP, or by updating the timezonedb.