O'Reilly logo

Building a Web Application with PHP and MariaDB: A Reference Guide by Sai Srinivas Sriparasa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Date datatypes

Let us now look at the following main date datatypes:

Datatype

Explanation

Comments

Date

This stores the date in YYYY-MM-DD format.

The supported range is from 1000-01-01 to 9999-12-31.

Time

This stores the time in HHH:MM:SS format.

The supported range is from -838:59:59 to 838:59:59.

datetime

This stores both the date and time in YYYY-MM-DD HH:MM:SS format.

The supported range is from 1000-01-01 00:00:00 to 9999-12-31 23:59:59.

Timestamp

This stores both the date and time.

The supported range is from 1970-01-01 00:00:01 UTC to 2038-01-19 03:14:07 UTC.

year (L)

This stores the year in either a 2-digit or a 4-digit format. The length of the year can be specified during declaration. The default is a 4-digit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required