0

This is my table:

CREATE TABLE tblWidget (
    id int,
    title varchar(255),
    name varchar(255),
    dateAdded datetime NOT NULL DEFAULT NOW());

and this is my insert query:

INSERT INTO tblWidget (id, title, name)
    VALUES (602, 'title', 'name');

and the values after executing the select statement are:

id   title   name   dateAdded
607  title   name   2016-03-10 23:04:20

Everything is ok except time. At the time of insertion the time of my computer was 3:15 and inserted time was different.

2
  • 1
    You might be interested stackoverflow.com/questions/930900/… Commented Mar 10, 2016 at 10:26
  • Which version are you running? What timezones are in effect on the two machines? Commented Mar 11, 2016 at 4:34

1 Answer 1

2

NOW() gets datetime from machine where MySQL server runs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.