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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:19:27+00:00 2026-06-12T23:19:27+00:00

I store times in MySQL sent from a PHP script as CURRENT_TIMESTAMP . This

  • 0

I store times in MySQL sent from a PHP script as CURRENT_TIMESTAMP. This makes times from the wrong timezone, minus 1 hour from where I am. I’m not superuser, so SET GLOBAL time_zone = 'Europe/London'; won’t work. Is there anyway I can modify the input or output query to compensate 1 hour?

This is my current sql query, sent from a form:

REPLACE INTO `order_admin_message` (`order_id`, `message`, `date_updated`)
VALUES ('$number', '$msg', CURRENT_TIMESTAMP)

And then I retreive it using:

SELECT order_admin_message.message, order_admin_message.date_updated
FROM order_admin_message
WHERE order_admin_message.order_id = $number

EDIT: To be clear, I don’t want to show the user’s time, just local London time (taking daylight saving into account in summer).
EDIT 2: Changed the subject to be closer to the question/answer.

  • 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-06-12T23:19:29+00:00Added an answer on June 12, 2026 at 11:19 pm

    In PHP, just change it for your display. Don’t store locale dependent dates or times in a database. Makes conversion later on, a PITA. Just display the time/timezone you need even if you don’t care about the user.

    $tz = new DateTimeZone('Europe/London');
    
    $datetime_updated = new DateTime($results['order_admin_message.date_updated']);
    $datetime_updated->setTimezone($tz);
    $display_date = $datetime_updated->format("M j, Y g:i A");
    
    echo $display_date;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MY previous site used DATETIME fileds in MySQL to store all dates/times. On my
How would you deal with times and after midnight in PHP / MySQL? Use
I am writing a query in php using a string sent from a android
Using MySQL should I store time data as an Int which would be the
I'm using MySQL and I currently have a VARCHAR column which stores times (in
I would like to store some analytics figures. For example, the amount of times
Longtext datatype is the largest capacity(4bytes) datatype in mysql. But it is not enough
I want to store the timestamp which a row was inserted into a MySQL
I'm wondering what's the best column type to store latitude/longitude on MySQL + Rails.
I am seeing mysql insert times performing orders of magnitude slower when called over

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.