tags:

views:

49

answers:

2

Suppose I have a DateTime field called "time_before"

I want to insert a datetime that is 1 hour before the now() time.

INSERT INTO mytable(time_before) VALUES(now()-3600 seconds)...something like this, right?
+2  A: 
INSERT INTO mytable(`time_before`) VALUES(NOW() - INTERVAL 1 HOUR)
Tatu Ulmanen
A: 

That's wrong database design. why not to insert just current datetime? All calculations must be done at select time.

Col. Shrapnel
Why the downvote? I'd like to know what his advice is about, actually
TIMEX