Solved

specifically why is time different on different servers

Posted on 2014-02-17
3
158 Views
Last Modified: 2014-02-17
<?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.
0
Comment
Question by:rgb192
  • 2
3 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39865489
The difference is almost certainly due to the PHP Timezone settings.  You can check this by printing out the return value from date_default_timezone_get().
0
 

Author Closing Comment

by:rgb192
ID: 39865552
timezone_set at the top of the code

thanks
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39865564
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now