0

I know that this has been asked but my problem is little different i think.. I get the response from a WCF JSON web service..

$reservation->ChIn=substr($reservation->ChIn,6,-10);

This extracts the timestamp but wastes the +0300 timezone info.

Then calling $chi=getdate($reservation->ChIn);
However that may have a problem because even if i set the timezone in page,is getdate aware of it? Because server knows whether timezone is +02 or 03 because of daylight saving.
Another solution would be to add offset * 60 * 60 to timestamp.

GorillaApe
  • 3,611
  • 10
  • 63
  • 106

1 Answers1

0

If you want to set default timezone you can set it in 2 ways:

  1. Put the default timezone in your php.ini (will require bounce of apache web server).
  2. Put this line on top of your PHP script:

    date_default_timezone_set(@date_default_timezone_get());
    
anubhava
  • 761,203
  • 64
  • 569
  • 643