We could use a normal character field to store date or time information. But DATE, DATETIME, and TIMESTAMP are more efficient for this purpose. MySQL checks the contents to ensure valid date and time information, and offers special functions to work on these fields.
As an added benefit,phpMyAdmin offers a calendar pop up for easy data entry.
We will start by adding a DATE field—date_published—to our book table. If we go into Insert mode, we should now see the new field where we could type a date. A Calendar icon is also available:
This icon brings a pop-up window, synchronized to this DATE field. If there ...