Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6580309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:00:40+00:00 2026-05-25T16:00:40+00:00

My server’s timezone is in Eastern Time. When I first built my members table

  • 0

My server’s timezone is in Eastern Time. When I first built my members table I went ahead and required members to set their timezone when signing up so that I could add timezone support later.

For example, a member signs up and chooses Eastern time for their timezone. The information in the database would look like “-5”.

The default timestamp I have stored is in Y-m-d H:i:s format. Now how difficult would this be to convert using only the offsets? I want to submit one timestamp (whatever timezone would be best to use with offsets) into the database when a post is made and then just convert it to the user’s timezone based on their offset in database when the content is displayed to them.

Any sample code or short tutorial would be great.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:00:41+00:00Added an answer on May 25, 2026 at 4:00 pm

    Assuming you did the right thing and are storing timestamps using the MySQL timestamp datatype, and not the datetime date type, all you have to do is SET time_zone = .... as a MySQL query, and the timestamp will convert.

    datetime data types do not convert on their own, but you can convert them yourself.

    You will have some issues with daylight savings time though. It’s best to store timezones as America/New_York, and things like that. Not numbers.

    See the php timezone_identifiers_list() function which will give you a list of possible timezones. The result of that can be used with both PHP and MySQL. I typically load the timezone from the users profile then do:

    date_default_timezone_set('....');
    mysql_query("SET time_zone = '....'");
    

    Then everything just works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQL SERVER, I'm working with a table that uses a guid for the key
SMTP server response: 530 5.7.0 Must issue a STARTTLS command first I get this
Server Management Studio tends to be a bit un-intuitive when it comes to managing
Server virtualization is a big thing these days, so I'm tasked at work to
Server 2008 machine with SP1, Visual Studio 2008 with SP1. My user; Developer, is
Server has created a socket and bound to a port and started a thread
Server.UrlEncode(My File.doc) returns My+File.doc, whereas the javascript escape(My File.doc) returns My%20File.doc. As far as
SQL Server Version 2000. We've a bunch of desktops talking to MSSQL Server. When
The server.xml which controls the startup of Apache Tomcat's servlet container contains a debug
SQL Server 2000 Standard, Windows 2003 My coworker removed 'BUILTIN\Administrators' group from SQL Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.