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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:11:07+00:00 2026-05-26T21:11:07+00:00

SEE: Update timestamp column in Application or Database? I’m trying to model something similar

  • 0

SEE: Update timestamp column in Application or Database?

I’m trying to model something similar in Workbench, but I don’t know where to set the “ON UPDATE” part. The best I can get is the following:

-- -----------------------------------------------------
-- Table `foo`.`test`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `foo`.`test` ;

CREATE  TABLE IF NOT EXISTS `foo`.`test` (
  `test_id` INT NOT NULL ,
  `date_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
  `date_updated` TIMESTAMP NOT NULL DEFAULT 0 ,
  PRIMARY KEY (`test_id`) )
ENGINE = InnoDB;

Where do I go in Workbench to set up this ON UPDATE part?

Also, I have a rule that all timestamps stored in the database should be UTC. How do I make CURRENT_TIMESTAMP, NOW, etc. be UTC?

  • 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-26T21:11:07+00:00Added an answer on May 26, 2026 at 9:11 pm

    I am using MySQL Workbench 5.2.35. Open create/alter table panel, switch to the columns tab, right click on the timestamp field; there you can see possible default and on update options.

    Important note: You can use CURRENT_TIMESTAMP as default or updated value for only a single column in a table!

    Sample screenshot showing the context menu

    Regarding the UTC question, you can have a look at this question. There is an accepted solution there.

    I would suggest you to read MySQL reference manuals as well for Timestamp data type and NOW() function.

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

Sidebar

Related Questions

I see that EF can update a model based on an existing database schema.
Update: OK I see it's a bubble sort, but is it less efficient because
I see the answer here is no, but wondered if there is any update
Update: this question, including the title, was rephrased, see history for details I know
I am having problems using the update method of scala.collection.immutable.HashMap.I don't see the reason
I have a timestamp column in my database, and i use it for almost
Update: See the bottom of this question for a C# workaround. Hi there, Consider
Update: After some more reading I see that this problem is totally general, you
Update: Solved, with code I got it working, see my answer below for the
UPDATE The issue is solved, all the code you can see works. Hello! I

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.