4

I have tried this code to get the current date in EST timezone,

$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 storedate displays 1 hr late datetime. I think this is because of the daylight saving time. Please provide me the best way to get current date in EST timezone considering Daylight saving time.

Sridhar
  • 2,228
  • 10
  • 48
  • 79

0 Answers0