指定されたGMT日時(YYYY-MM-DD HH:MM)を、東海岸の日付を表すこのような文字列YYYYMMDDに変換する必要があります。以下のコードは大丈夫だと思いますか?
$date='2011-11-07 04:30';
$date.='-4 hours';
$date=strftime('%Y-%m-%d %H:%M',strtotime($date));
$y=gmdate('Y');
$date2=date('Y-m-d 02:00',strtotime($y.'-03-01 second sunday'));
$date3=date('Y-m-d 02:00',strtotime($y.'-11-01 first sunday'));
if($date<=$date2||$date>=$date3) {
$date.='-1 hour';
$date=strftime('%Y-%m-%d %H:%M',strtotime($date));
}
$date=date('Ymd', strtotime($date));