Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Current date & time in MySQL datetime format

0 views
Skip to first unread message

Phil Schwarzmann

unread,
Jun 22, 2002, 12:56:26 PM6/22/02
to php-g...@lists.php.net
I want to produce the current date & time in a MySQL datetime format
that I can then put into a MySQL database.

How do I do this? I've tried mktime() and getdate() but it's not
working.

Thanks!!

Austin Marshall

unread,
Jun 22, 2002, 2:23:43 PM6/22/02
to Phil Schwarzmann, php-g...@lists.php.net

If you want to do it with mysql (i.e. insert the current time) use NOW()
(the mysql function) for example INSERT INTO foo (date) VALUES (NOW())

John Holmes

unread,
Jun 22, 2002, 2:22:31 PM6/22/02
to Phil Schwarzmann, php-g...@lists.php.net
Use NOW() in your query...

INSERT INTO table VALUES (NOW()),'John');

---John Holmes...

0 new messages