Tag Archives: MySQL

How To Assign The Current Date and Time to a MySQL Datetime Field using PHP

By | February 18, 2010

This is a no-brainer, but I always forget how to do it. MySQL datetime fields are stored in this format: 2010-02-18 10:33:18. Here’s a trivial example showing you how to populate a datetime field with the current date in the correct format, then write it to a table: Another question might be: “Why?” – when… Read More »