Solved

unix timestamp is hardcoded in my table but appears different on different host (timezones)

Posted on 2014-02-14
2
205 Views
Last Modified: 2014-02-17
old code, will update soon because does not use pdo, mysqli
code uses mysql

$qfetch='SELECT * from email_doc';
$fetch=mysql_query($qfetch);
while ( $row = mysql_fetch_object( $fetch ) );



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


this is unix_timestamp which is unix_timestamp with an hour added



1379358861
1379359341
1379362620
1379445757
1379446700
1379448620
1379492114

these values are different on different servers.  Is there a way to set timestamp

I created another column and I need to add 4-6 hours depending upon which server I am hosting information even though value is hardcoded in datebase table.
0
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39859408
Please read the article here.  Look for the part about PHP and MySQL Have Different Time Zone Settings (but please read the entire article - it has background information you need in order to understand what you're getting into!)
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
0
 

Author Closing Comment

by:rgb192
ID: 39865470
I have read the article and I do not know why this specifically occurs so I have created a question with more details and testing.  Thanks for the information.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

726 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