: Why is my Last-Modified header always sent using GMT timezone? 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
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
More posts by @Chiappetta492
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.