{"id":310,"date":"2021-11-22T10:48:33","date_gmt":"2021-11-22T10:48:33","guid":{"rendered":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/?p=310"},"modified":"2021-11-22T10:48:33","modified_gmt":"2021-11-22T10:48:33","slug":"date-and-time-types","status":"publish","type":"post","link":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/2021\/11\/22\/date-and-time-types\/","title":{"rendered":"DATE and TIME types"},"content":{"rendered":"\n<p>The main remaining data types supported by MySQL relate to the date and time and can be seen in next table.<\/p>\n\n\n\n<p>Data type                           Time\/date format<br>DATETIME                        &#8216;0000-00-00 00:00:00&#8217;<br>DATE                                     &#8216;0000-00-00&#8217;<br>TIMESTAMP                     &#8216;0000-00-00 00:00:00&#8217;<br>TIME                                      &#8217;00:00:00&#8242;<br>YEAR 0000                         (Only years 0000 and 1901\u20132155)<\/p>\n\n\n\n<p>The DATETIME and TIMESTAMP data types display the same way. The main difference is that TIMESTAMP has a very narrow range (from the years 1970 through 2037), whereas DATETIME will hold just about any date you\u2019re likely to specify, unless you\u2019re interested in ancient history or science fiction. TIMESTAMP is useful, however, because you can let MySQL set the value for you. If you don\u2019t specify the value when adding a row, the current time is automatically inserted. You can also have MySQL update a TIMESTAMP column each time you change a row.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The main remaining data types supported by MySQL relate to the date and time and can be seen in next table. Data type Time\/date formatDATETIME &#8216;0000-00-00 00:00:00&#8217;DATE &#8216;0000-00-00&#8217;TIMESTAMP &#8216;0000-00-00 00:00:00&#8217;TIME &#8217;00:00:00&#8242;YEAR 0000 (Only years 0000 and 1901\u20132155) The DATETIME and TIMESTAMP data types display the same way. The main difference is that TIMESTAMP has a &hellip; <a href=\"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/2021\/11\/22\/date-and-time-types\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">DATE and TIME types<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/310"}],"collection":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=310"}],"version-history":[{"count":1,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/310\/revisions"}],"predecessor-version":[{"id":311,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/310\/revisions\/311"}],"wp:attachment":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}