PHP: get current date in EST timezone considering DayLightSaving Time

I tried this code to get the current date in the EST time zone,

$currentDate=date("Y-m-d h:i A");
$timezone='EST';
date_default_timezone_set($timezone);
$storedate=date("Y-m-d h:i A");
echo $currentDate."  ===  ".$storedate."<br/><br/>";

The keeper displays the expiration time for 1 hour. I think this is due to summer time. Please provide me with the best way to get the current date in EST timezone based on daylight saving time.

+5
source share

All Articles