I want to send the last-modified in IST timezone, But it always sends in GMT. What is wrong with this PHP code?
echo "Timezone " . date_default_timezone_get () ; //==>verified, timezone set correctly Asia/Kolkata
$timezone = new DateTimeZone("Asia/Kolkata");
$date = new DateTime($this->item->modified);
$date->setTimezone($timezone );
$mod_time = trim ($date->format('D, d M Y H:i:s'));
echo $mod_time;
header("Last-Modified: ". $mod_time . " IST", true) ;
// header("Last-Modified: ". $mod_time . " IST", true) ; //==> Tried this also, still sends in GMT
$date = new DateTime($this->item->modified, new DateTimeZone('Asia/Kolkata'));
? I'm following the example from the documentation: php.net/manual/en/datetime.settimezone.php