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 659097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:00:25+00:00 2026-05-13T23:00:25+00:00

I have a list of dates stored in MySQL using PHP. These were stored

  • 0

I have a list of dates stored in MySQL using PHP.

These were stored using the following code:

date_default_timezone_set('UTC');
$strDate = date("Y-m-d H:i:s",time());

I can only test this from my timezone, which is also UTC!

If a web visitor from eg Eastern Time USA views the page, will the date be converted to UTC correctly?

Presuming that I am storing the UTC dates correctly, what PHP function will display the UTC time, converted to the user’s own timezone??

  • 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-13T23:00:25+00:00Added an answer on May 13, 2026 at 11:00 pm

    Firstly you’re right to store the UTC; however remember that the date you have in PHP will be the server date – not the client date.

    So to continue, read up on how to extract timezone based dates. Then consider how to extract the timezone from the browser – which you will need if you do the local timezone output in PHP rather than on the client.

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

Sidebar

Related Questions

I have a list of dates stored in a MYSQL table, the idea is
I have a list of dates for an event in the following format 13/04/2010
In MySQL, If I have a list of date ranges (range-start and range-end). e.g.
I have a list of dates in a table in a MySQL database (the
I have a simple list-type php page, which lists items according to a mysql
I have a stored function in MySQL: CREATE FUNCTION `login_count`(o INT, start_date DATE, end_date
I have populated a sorted list of dates(stored as strings in the format dd/mm/yyyy)
I have the following stored procedure which takes a user ID, a starting date,
I have a list of dates that a machine has worked on, but it
I need to display a list of dates, which I have in a table

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.