Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

specifically why is time different on different servers

<?php
$row->real_timestamp='1392598061';
echo ' '.date("D", $row->real_timestamp);
echo'<br>'.date("M j, g:i A", $row->real_timestamp);

Open in new window


one server has output
Mon
Feb 17, 12:47 AM


another server
Warning: Creating default object from empty value in C:\wamp\www\test\real_timestamp.php on line 2
Sun
Feb 16, 7:47 PM

I have simplified this code because I am selecting mysql field and I have to add different numbers in order to show the real time.

I am looking for a specific reason why this occurs and not a link to php time.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

timezone_set at the top of the code

thanks
You can also set the timezone as a PHP initialization setting, which makes sense because the server will rarely change time zones -- they are related to geography.