Reputation: 91
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.
Upvotes: 0
Views: 620
Reputation: 5262
NOW() gets datetime from machine where MySQL server runs.
Upvotes: 2