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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:49:49+00:00 2026-06-03T02:49:49+00:00

Assume the following table: CREATE TABLE IF NOT EXISTS `test` ( `stamp` timestamp NOT

  • 0

Assume the following table:

CREATE TABLE IF NOT EXISTS `test` (
  `stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

When I run the following SQL:

SET time_zone = '+00:00';
INSERT INTO `test` (`stamp`) VALUES (CURRENT_TIMESTAMP);

The value in test is my machine’s local time instead of UTC.

According to MySQL site

Values for TIMESTAMP columns are converted from the current time zone
to UTC for storage, and from UTC to the current time zone for
retrieval.

What am I doing wrong? I want to store my records with UTC date/time stamp and retrieve them in the user’s local time zone.

  • 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-03T02:49:49+00:00Added an answer on June 3, 2026 at 2:49 am

    According to the MySQL 5.5 documentation using the TIMESTAMP data type will default to using the server’s time zone unless you change the variable from the client side.

    From: http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html

    Per-connection time zones. Each client that connects has its own time
    zone setting, given by the session time_zone variable. Initially, the
    session variable takes its value from the global time_zone variable,
    but the client can change its own time zone with this statement:

    mysql> SET time_zone = timezone;

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

Sidebar

Related Questions

Given the following tables: CREATE TABLE tree ( id serial NOT NULL, name character
Lets assume I have the following table create table Article ( ART_ID bigint not
Let's assume that I have the following table: CREATE TABLE [dbo].[PricesHist] ( [Product] [varchar](6)
Assume the following in MySQL: CREATE TABLE users ( id integer auto_increment primary key,
I have got the following simplified schema: CREATE TABLE [file] ( id UNIQUEIDENTIFIER NOT
Assume I have the following style table, col1 col2 and col3 have same value
assume this following function: int binaryTree::findHeight(node *n) { if (n == NULL) { return
In my database, assume we have a table defined as follows: CREATE TABLE [Chemical](
Assume a table definition in SQL Server as follows: CREATE TABLE MyTable ( Id
I have a question about MySQL InnoDB. For example: I have the following 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.