在PHP中将EDT转换为GMT + 05.30时区,以便在mysql数据库中输入时间戳

My php web servers timezone is EDT (Eastern Day Light Time (US)). My current timezone is GMT+05.30. I need to enter current timestamp into my mysql database with the timestamp in my current timezone. By the way, I'm using a free php web server for my use. So I will not be having any previleges for modifying the server. Can some one suggest me some way of converting it to my GMT+05.30 from EDT in php using any script.Thanks in advance.

Have a look at the following example

$timezone = new DateTimeZone('Europe/Berlin');
$date = new DateTime('@' . $yourTimestamp, $timezone);

echo $date->format('c');

So through the DateTimeZone Object your Time will be formatted by the DateTime object.

I suggest you use the date_default_timezone PHP function. You can read about it here and here is the list of Supported Timezones

Example:

<?php
    date_default_timezone_set('Europe/Amsterdam');
?>

Use this:

echo gmdate("Y:F:l     h:i:s",time()+19800);