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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:44:19+00:00 2026-06-10T01:44:19+00:00

If I run the following query: ALTER TABLE `price_s` ADD COLUMN `ts` TIMESTAMP NOT

  • 0

If I run the following query:

ALTER TABLE `price_s` ADD COLUMN `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP  AFTER `price_s_id` ;

The new column would be populated with 0000-00-00 00:00:00.
Value in this column won’t get updated to Current Timestamp until I modify the column, i.e. ON UPDATE CURRENT_TIMESTAMP seems to work fine.

If I run :

SELECT version( ) , @@time_zone , @@system_time_zone , NOW( ) , UTC_TIMESTAMP( )

I got:

'5.5.15', '+10:00', 'EST', '2012-08-23 14:56:59', '2012-08-23 04:56:59'

I’d like to store the UTC time in the column ts, how do I do that?

Not sure if this is relevant, I have tried to generate the mysql.time_zone* tables:

Miranda-Macbook: ./mysql_tzinfo_to_sql /usr/share/zoneinfo | ./mysql -p -u root mysql
Enter password: Warning: Unable to load '/usr/share/zoneinfo/+VERSION' as time zone. Skipping it.

Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh87' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh88' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh89' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh87' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh88' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh89' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.

Thanks @Sameer and @Marc B.
Now I understands timestamp more.(with the help of this article)
It is already stored in UTC, so what I need is actually:

SET time_zone = 'SYSTEM';
UPDATE tablename SET ts=now()
  • 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-10T01:44:21+00:00Added an answer on June 10, 2026 at 1:44 am
    INSERT INTO yourtable (ts) VALUES (now())
    UPDATE yourtable SET ts=now()
    

    As long as whatever you’re stuffing into the ts field is a valid mysql timestamp string (yyyy-mm-dd hh:mm:ss) it doesn’t matter WHAT the timezone is. That only becomes relevant upon conversion or retrieval – mysql datefields themselves have no concept of timezones, they’re just repositories of some date/time data.

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

Sidebar

Related Questions

I'm trying to run the following query, but am not sure how to limit
I try to run the following raw query in android, it seems not work
I'm adding a new, NOT NULL column to my Postgresql database using the following
After the excellent answer by Alexandre GUIDET, I attempted to run the following query:
I am trying to run the following query, but I am not sure if
I can run the following query in PHPMyAdmin, but for some reason I get
I am trying to run the following query: SELECT COUNT(*) FROM ( SELECT *
I am trying to run the following query to insert a number of nodes
I'm trying to run the following query, and I'm having trouble with the wildcard.
I'm trying to run the following query from phpMyAdmin (on a local WAMP 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.