Skip to main content
deleted 39 characters in body
Source Link
John Conde
  • 220.4k
  • 100
  • 464
  • 504

So we have in-house servers here in this EDT part of the USA America/New_York and for someone reason, this SSCCE[SSCCE][1] code is not working.

<?php echo date_default_timezone_get() . " <br />"; $dateCal = "2015-06-22 13:00:00"; // EDT Time $schedule_date = new DateTime($dateCal, new DateTimeZone("America/Chicago") ); echo $dateCal . " <br />"; // 2015-06-22 13:00:00 echo date_format($schedule_date, 'Y-m-d H:i:s T'); // 2015-06-22 13:00:00 CDT ?> 

The output results in:

UTC 2015-06-22 13:00:00 2015-06-22 13:00:00 CDT 

When the 2nd time should be 12 NOON, instead of 1PM.

How do I fix this?

Thanks.

So we have in-house servers here in this EDT part of the USA America/New_York and for someone reason, this SSCCE code is not working.

<?php echo date_default_timezone_get() . " <br />"; $dateCal = "2015-06-22 13:00:00"; // EDT Time $schedule_date = new DateTime($dateCal, new DateTimeZone("America/Chicago") ); echo $dateCal . " <br />"; // 2015-06-22 13:00:00 echo date_format($schedule_date, 'Y-m-d H:i:s T'); // 2015-06-22 13:00:00 CDT ?> 

The output results in:

UTC 2015-06-22 13:00:00 2015-06-22 13:00:00 CDT 

When the 2nd time should be 12 NOON, instead of 1PM.

How do I fix this?

Thanks.

So we have in-house servers here in this EDT part of the USA America/New_York and for someone reason, this [SSCCE][1] code is not working.

<?php echo date_default_timezone_get() . " <br />"; $dateCal = "2015-06-22 13:00:00"; // EDT Time $schedule_date = new DateTime($dateCal, new DateTimeZone("America/Chicago") ); echo $dateCal . " <br />"; // 2015-06-22 13:00:00 echo date_format($schedule_date, 'Y-m-d H:i:s T'); // 2015-06-22 13:00:00 CDT ?> 

The output results in:

UTC 2015-06-22 13:00:00 2015-06-22 13:00:00 CDT 

When the 2nd time should be 12 NOON, instead of 1PM.

How do I fix this?

Source Link
Gao Lin
  • 59
  • 1
  • 7

PHP Timezone not working correctly

So we have in-house servers here in this EDT part of the USA America/New_York and for someone reason, this SSCCE code is not working.

<?php echo date_default_timezone_get() . " <br />"; $dateCal = "2015-06-22 13:00:00"; // EDT Time $schedule_date = new DateTime($dateCal, new DateTimeZone("America/Chicago") ); echo $dateCal . " <br />"; // 2015-06-22 13:00:00 echo date_format($schedule_date, 'Y-m-d H:i:s T'); // 2015-06-22 13:00:00 CDT ?> 

The output results in:

UTC 2015-06-22 13:00:00 2015-06-22 13:00:00 CDT 

When the 2nd time should be 12 NOON, instead of 1PM.

How do I fix this?

Thanks.