The best way of doing this is to use the command now() in your sql statement for both date and time, e.g.:

INSERT INTO MYTABLE (MYDATE, DESCRIPTION) VALUES (now(), description);

If you just want the date only then use CURDATE()

INSERT INTO MYTABLE (MYDATE, DESCRIPTION) VALUES (curdate(), description);

How do I get the latest date and time in an SQL query

Leave a Reply

Your email address will not be published. Required fields are marked *

− one = one