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

  • Home
  • SEARCH
  • 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 6129051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:41:50+00:00 2026-05-23T16:41:50+00:00

I’m currently storing dates in my MYSQL database as a PHP timestamp (integer field).

  • 0

I’m currently storing dates in my MYSQL database as a PHP timestamp (integer field). However, if I retrieve it from the database and use the PHP date function, would it display the correct time based on the client’s time zone.

For example, I display a PHP timestamp 1310674625 (pulled from DB) which is Jul 14 2011 22:17:05 in Eastern Time. So if I display the timestamp in PHP with the code below, would a person viewing the webpage in the Pacific Time Zone see Jul 14 2011 19:17:05 instead?

echo date('M d Y H:i:s', 1310674625);
  • 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-23T16:41:50+00:00Added an answer on May 23, 2026 at 4:41 pm

    No. The date will be displayed according to the server’s time and timezone, not the user’s.

    You can offer an option on your site to allow the user provide his/her timezone (or attempt to use geolocation based on the IP) and adjust the output according.

    According to this post, reliably determining the user’s timezone may not be possible, so for best results, you may need to get input from the user.

    EDIT (Based on the request for more information in the comments)

    If you need to output the selected timezone, you can use one of the following options:

    echo date('e'); // Examples: UTC, GMT, Atlantic/Azores (Available in version 5.1.0 and later
    echo date('O'); // Different in Greenwich meantime. Example: +0200
    echo date('T'); // Timezone abbreviation. Examples: EST, MDT ...
    

    See the date manual page for more information.

    EDIT 2:

    To “print the date to a specified timezone” you will need to:

    1. Get the current date as a timestamp (time())
    2. Get the user’s timezone offset
    3. Use mktime to add or subtract the user’s offset as needed.
    4. Convert the result back to human-readable format using date().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from

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.