{"id":5428,"date":"2024-11-14T12:17:54","date_gmt":"2024-11-14T04:17:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5428\/"},"modified":"2024-11-14T12:17:54","modified_gmt":"2024-11-14T04:17:54","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b8%addate%e7%9a%84%e9%95%bf%e5%ba%a6%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5428\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u4e2ddate\u7684\u957f\u5ea6\u600e\u4e48\u8bbe\u7f6e"},"content":{"rendered":"<blockquote><p>\n  mysql \u4e2d date \u6570\u636e\u7c7b\u578b\u957f\u5ea6\u4e3a 10 \u4e2a\u5b57\u7b26\uff0c\u4ee5 yyyy-mm-dd \u683c\u5f0f\u5b58\u50a8\u65e5\u671f\uff0c\u4e0d\u5b58\u50a8\u65f6\u95f4\u4fe1\u606f\uff0c\u9ed8\u8ba4\u503c\u4e3a 0000-00-00 \u8868\u793a\u7a7a\u65e5\u671f\u503c\u3002\u5176\u957f\u5ea6\u56fa\u5b9a\uff0c\u65e0\u6cd5\u8bbe\u7f6e\uff0c\u4e14\u5728 mysql 8.0 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\u4e0d\u518d\u5b58\u50a8\u65f6\u533a\u4fe1\u606f\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/28\/2024052812362193865.jpg\" class=\"aligncenter\" title=\"mysql\u6570\u636e\u5e93\u4e2ddate\u7684\u957f\u5ea6\u600e\u4e48\u8bbe\u7f6e\u63d2\u56fe\" alt=\"mysql\u6570\u636e\u5e93\u4e2ddate\u7684\u957f\u5ea6\u600e\u4e48\u8bbe\u7f6e\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u4e2d DATE \u6570\u636e\u7c7b\u578b\u7684\u957f\u5ea6<\/strong><\/p>\n<p>MySQL \u4e2d DATE \u6570\u636e\u7c7b\u578b\u7528\u4e8e\u5b58\u50a8\u65e5\u671f\u503c\uff0c\u5176\u957f\u5ea6\u4e3a 10 \u4e2a\u5b57\u7b26\uff08\u5b57\u8282\uff09\u3002\u5b83\u4ee5 YYYY-MM-DD \u7684\u683c\u5f0f\u5b58\u50a8\u65e5\u671f\uff0c\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>YYYY \u8868\u793a\u5e74\u4efd\uff08\u56db\u4f4d\u6570\u5b57\uff09<\/li>\n<li>MM \u8868\u793a\u6708\u4efd\uff08\u4e24\u4f4d\u6570\u5b57\uff09<\/li>\n<li>DD \u8868\u793a\u65e5\u671f\uff08\u4e24\u4f4d\u6570\u5b57\uff09<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff0c2023-05-17 \u8868\u793a 2023 \u5e74 5 \u6708 17 \u65e5\u3002<\/p>\n<p><strong>\u7279\u70b9<\/strong><\/p>\n<p>DATE \u6570\u636e\u7c7b\u578b\u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a<\/p>\n<ul>\n<li> <strong>\u8303\u56f4\uff1a<\/strong>\u4ece 1000-01-01 \u5230 9999-12-31<\/li>\n<li> <strong>\u7cbe\u5ea6\uff1a<\/strong>\u65e5\u671f\u7ea7\u522b\uff0c\u4e0d\u5b58\u50a8\u65f6\u95f4\u4fe1\u606f<\/li>\n<li> <strong>\u9ed8\u8ba4\u503c\uff1a<\/strong> 0000-00-00\uff0c\u8868\u793a\u7a7a\u65e5\u671f\u503c<\/li>\n<\/ul>\n<p><strong>\u8bbe\u7f6e\u957f\u5ea6<\/strong><\/p>\n<p>DATE \u6570\u636e\u7c7b\u578b\u7684\u957f\u5ea6\u662f\u56fa\u5b9a\u7684\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u3002\u5b83\u59cb\u7ec8\u4e3a 10 \u4e2a\u5b57\u7b26\u3002<\/p>\n<p><strong>\u5176\u4ed6\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<ul>\n<li>MySQL 5.7 \u53ca\u66f4\u65e9\u7248\u672c\u4e2d\uff0cDATE \u6570\u636e\u7c7b\u578b\u9519\u8bef\u5730\u5b58\u50a8\u4e86\u65f6\u533a\u4fe1\u606f\uff0c\u5bfc\u81f4\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u4f1a\u4ea7\u751f\u4e0d\u51c6\u786e\u7684\u65e5\u671f\u503c\u3002<\/li>\n<li>MySQL 8.0 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\uff0c\u6b64\u95ee\u9898\u5df2\u5f97\u5230\u4fee\u590d\uff0cDATE \u6570\u636e\u7c7b\u578b\u4e0d\u518d\u5b58\u50a8\u65f6\u533a\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u4e2ddate\u7684\u957f\u5ea6\u600e\u4e48\u8bbe\u7f6e\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mysql \u4e2d date \u6570\u636e\u7c7b\u578b\u957f\u5ea6\u4e3a 10 \u4e2a\u5b57\u7b26\uff0c\u4ee5 yyyy-mm-dd \u683c\u5f0f\u5b58\u50a8\u65e5\u671f\uff0c\u4e0d\u5b58\u50a8\u65f6\u95f4\u4fe1\u606f\uff0c\u9ed8\u8ba4\u503c\u4e3a 0000-00-00 \u8868\u793a\u7a7a\u65e5\u671f\u503c\u3002\u5176\u957f\u5ea6\u56fa\u5b9a\uff0c\u65e0\u6cd5\u8bbe\u7f6e\uff0c\u4e14\u5728 mysql 8.0 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\u4e0d\u518d\u5b58\u50a8\u65f6\u533a\u4fe1\u606f\u3002 MySQL \u4e2d DATE \u6570\u636e\u7c7b\u578b\u7684\u957f\u5ea6 MySQL \u4e2d DATE \u6570\u636e\u7c7b\u578b\u7528\u4e8e\u5b58\u50a8\u65e5\u671f\u503c\uff0c\u5176\u957f\u5ea6\u4e3a 10 \u4e2a\u5b57\u7b26\uff08\u5b57\u8282\uff09\u3002\u5b83\u4ee5 YYYY-MM-DD \u7684\u683c\u5f0f\u5b58\u50a8\u65e5\u671f\uff0c\u5176\u4e2d\uff1a YYYY \u8868\u793a\u5e74\u4efd\uff08\u56db\u4f4d\u6570\u5b57\uff09 MM \u8868\u793a\u6708\u4efd\uff08\u4e24\u4f4d\u6570\u5b57\uff09 DD \u8868\u793a\u65e5\u671f\uff08\u4e24\u4f4d\u6570\u5b57\uff09 \u4f8b\u5982\uff0c2023-05-17 \u8868\u793a 2023 \u5e74 5 \u6708 17 \u65e5\u3002 \u7279\u70b9 DATE \u6570\u636e\u7c7b\u578b\u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a \u8303\u56f4\uff1a\u4ece 1000-01-01 \u5230 9999-12-31 \u7cbe\u5ea6\uff1a\u65e5\u671f\u7ea7\u522b\uff0c\u4e0d\u5b58\u50a8\u65f6\u95f4\u4fe1\u606f \u9ed8\u8ba4\u503c\uff1a 0000-00-00\uff0c\u8868\u793a\u7a7a\u65e5\u671f\u503c \u8bbe\u7f6e\u957f\u5ea6 DATE \u6570\u636e\u7c7b\u578b\u7684\u957f\u5ea6\u662f\u56fa\u5b9a\u7684\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u3002\u5b83\u59cb\u7ec8\u4e3a 10 \u4e2a\u5b57\u7b26\u3002 \u5176\u4ed6\u6ce8\u610f\u4e8b\u9879 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5428","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5428"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5428\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}