Question:
MySQL Timestamp problem?
Manish
2006-08-10 11:54:04 UTC
I am using PHP, MySQL, javascript and AJAX for my new website. My server is in US but I live in london. Now i have like a sticky note thing on my website using ajax. It records the date and time when it was created or modified. Everytime it is modified or created new, the timestamp records the US time but i need the UK time on it. Is it possible, if so how?

Thankyou
Five answers:
2006-08-10 12:15:25 UTC
I believe you can use PHP to set your time zone. Then insert the time zone dates into your MySQL rather than letting the database default to it's time.



One step furthur might be to always store the GMT time, then you can out put the time based on the user's time zone farly eaisily.



date_default_timezone_set

http://ca.php.net/manual/en/function.date-default-timezone-set.php



date

http://ca.php.net/manual/en/function.date.php
money
2006-08-13 22:46:12 UTC
We the surfers of cyber world meet with so many people every day. Surfing the net is the best pastime one can ever develop, as internet has the most knowledge, a surfer will never have to wait for a answer. The vast knowledge of cyber world is nothing as compared to the cyber society that it gives. Internet is a community but so vast that we need a place to make conversation easy. What more can be better than a chat room for this purpose, well a chat room and a message board along with a forum is the best combination really. I was actually looking for a place where we can find all these things with a profile and photo brouse option. Finally I got this site, this place is a very nice community where we can share every thing online. And also about the leader board, I must tell it is great. The thought of the leader board is unique, as not to many people has thought about this thing. And the method of getting the leader is very different and one must check out this site once. The cyber culture is growing, and it is about time that we find our club and that to a very different club, which is not a part of any big website house like the yahoo and google. This site am talking about has every thing that a cyber surfer ever wants. This is the website address, http://www.friendscyberclub.com/ Features of this site is: 1) chatting 2) view profiles and photos 3) upload your photos and make a cool profile. 4) your message board 5) forum 6) See your name on the leader board. There are also many more features available in the site, free to join.
clievers
2006-08-10 12:11:53 UTC
Prior to inserting/updating the mysql record can you capture the current date/time and convert it to your desired format (add subtract UTC ?), get the long/unixtime value of it then use mysql's FROM_UNIXTIME function to store it?
2006-08-14 04:17:11 UTC
This website gives you free traffic, it's free to join, you earn here free credit, with which you get free traffic to your website, http://www.trafficswarm.com/go.cgi?537476 then there are other features, there are tools and other things that will help you with other things about your website, first 100 credits will activate your account, you will find out in the website how you get free credits,
muoreh
2006-08-10 17:20:11 UTC
the easiest possible solution is to set the clock of your server in US to UK time =)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...