{"id":135,"date":"2024-08-23T09:23:20","date_gmt":"2024-08-23T09:23:20","guid":{"rendered":"https:\/\/www.yehger.com\/?p=135"},"modified":"2024-09-25T06:28:28","modified_gmt":"2024-09-25T06:28:28","slug":"5-mysql-date-and-time-data-types","status":"publish","type":"post","link":"https:\/\/www.yehger.com\/index.php\/2024\/08\/23\/5-mysql-date-and-time-data-types\/","title":{"rendered":"5. Mysql \u2013 Date and Time Data Types"},"content":{"rendered":"<h2>Date and Time Data Types<\/h2>\n<table>\n<thead>\n<tr>\n<th>Data type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>DATE<\/td>\n<td>A date. Format: YYYY-MM-DD. The supported range is from '1000-01-01' to '9999-12-31'<\/td>\n<\/tr>\n<tr>\n<td>DATETIME(fsp)<\/td>\n<td>A date and time combination. Format: YYYY-MM-DD hh:mm:ss. The supported range is from '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. Adding DEFAULT and ON UPDATE in the column definition to get automatic initialization and updating to the current date and time<\/td>\n<\/tr>\n<tr>\n<td>TIMESTAMP(fsp)<\/td>\n<td>A timestamp. TIMESTAMP values are stored as the number of seconds since the Unix epoch ('1970-01-01 00:00:00' UTC). Format: YYYY-MM-DD hh:mm:ss. The supported range is from '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC. Automatic initialization and updating to the current date and time can be specified using DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP in the column definition<\/td>\n<\/tr>\n<tr>\n<td>TIME(fsp)<\/td>\n<td>A time. Format: hh:mm:ss. The supported range is from '-838:59:59' to '838:59:59'<\/td>\n<\/tr>\n<tr>\n<td>YEAR<\/td>\n<td>A year in four-digit format. Values allowed in four-digit format: 1901 to 2155, and 0000. MySQL 8.0 does not support year in two-digit format.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Date and Time Data Types Data type Description DATE A date. Format: YYYY-MM-DD. The supported range is from &#8216;1000-01-01&#8217; to&#8230; <a class=\"read-more\" href=\"https:\/\/www.yehger.com\/index.php\/2024\/08\/23\/5-mysql-date-and-time-data-types\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":1,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":137,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/135\/revisions\/137"}],"wp:attachment":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}