{"id":161,"date":"2012-01-04T10:21:39","date_gmt":"2012-01-04T10:21:39","guid":{"rendered":"https:\/\/shan.info\/new\/mysql-to_days-date-%e5%87%bd%e6%95%b0\/"},"modified":"2012-01-04T10:21:39","modified_gmt":"2012-01-04T10:21:39","slug":"mysql-to_days-date-%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/mysql-to_days-date-%e5%87%bd%e6%95%b0\/","title":{"rendered":"mysql TO_DAYS(date) \u51fd\u6570"},"content":{"rendered":"<h3>TO_DAYS(<em>date<\/em>)<\/h3>\n<p>\u7ed9\u5b9a\u4e00\u4e2a\u65e5\u671f<em>date<\/em>, \u8fd4\u56de\u4e00\u4e2a\u5929\u6570 (\u4ece\u5e74\u4efd0\u5f00\u59cb\u7684\u5929\u6570 )\u3002<\/p>\n<p>mysql&gt; <strong>SELECT TO_DAYS(950501);<\/strong><\/p>\n<p>-&gt; 728779<\/p>\n<p>mysql&gt; <strong>SELECT TO_DAYS(\u20181997-10-07\u2032);<\/strong><\/p>\n<p>-&gt; 729669<\/p>\n<p>TO_DAYS() \u4e0d\u7528\u4e8e\u9633\u5386\u51fa\u73b0(1582)\u524d\u7684\u503c\uff0c\u539f\u56e0\u662f\u5f53\u65e5\u5386\u6539\u53d8\u65f6\uff0c\u9057\u5931\u7684\u65e5\u671f\u4e0d\u4f1a\u88ab\u8003\u8651\u5728\u5185\u3002<\/p>\n<p>\u8bf7\u8bb0\u4f4f\uff0c MySQL\u201c\u65e5\u671f\u548c\u65f6\u95f4\u7c7b\u578b\u201d\u4e2d\u7684\u89c4\u5219\u5c06\u65e5\u671f\u4e2d\u7684\u4e8c\u4f4d\u6570\u5e74\u4efd\u503c\u8f6c\u5316\u4e3a\u56db\u4f4d\u3002\u4f8b\u5982\uff0c&nbsp; \u20181997-10-07\u2032\u548c \u201897-10-07\u2032 \u88ab\u89c6\u4e3a\u540c\u6837\u7684\u65e5\u671f:<\/p>\n<p>mysql&gt; <strong>SELECT TO_DAYS(\u20181997-10-07\u2032), TO_DAYS(\u201897-10-07\u2032);<\/strong><\/p>\n<p>-&gt; 729669, 729669<\/p>\n<p>\u5bf9\u4e8e1582 \u5e74\u4e4b\u524d\u7684\u65e5\u671f(\u6216\u8bb8\u5728\u5176\u5b83\u5730\u533a\u4e3a\u4e0b\u4e00\u5e74 ), \u8be5\u51fd\u6570\u7684\u7ed3\u679c\u5b9e\u4e0d\u53ef\u9760\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TO_DAYS(date) \u7ed9\u5b9a\u4e00\u4e2a\u65e5\u671fdate, \u8fd4\u56de\u4e00\u4e2a\u5929\u6570 (\u4ece\u5e74\u4efd0\u5f00\u59cb\u7684\u5929\u6570 )\u3002 mysql&gt; SELECT TO_DAYS(950501); -&gt; 728779 mysql&gt; SELECT TO_DAYS(\u20181997-10-07\u2032); -&gt; 729669 TO_DAYS() \u4e0d\u7528\u4e8e\u9633\u5386\u51fa\u73b0(1582)\u524d\u7684\u503c\uff0c\u539f\u56e0\u662f\u5f53\u65e5\u5386\u6539\u53d8\u65f6\uff0c\u9057\u5931\u7684\u65e5\u671f\u4e0d\u4f1a\u88ab\u8003\u8651\u5728\u5185\u3002 \u8bf7\u8bb0\u4f4f\uff0c MySQL\u201c\u65e5\u671f\u548c\u65f6\u95f4\u7c7b\u578b\u201d\u4e2d\u7684\u89c4\u5219\u5c06\u65e5\u671f\u4e2d\u7684\u4e8c\u4f4d\u6570\u5e74\u4efd\u503c\u8f6c\u5316\u4e3a\u56db\u4f4d\u3002\u4f8b\u5982\uff0c&nbsp; \u20181997-10-07\u2032\u548c \u201897-10-07\u2032 \u88ab\u89c6\u4e3a\u540c\u6837\u7684\u65e5\u671f: mysql&gt; SELECT TO_DAYS(\u20181997-10-07\u2032), TO_DAYS(\u201897-10-07\u2032); -&gt; 729669, 729669 \u5bf9\u4e8e1582 \u5e74\u4e4b\u524d\u7684\u65e5\u671f(\u6216\u8bb8\u5728\u5176\u5b83\u5730\u533a\u4e3a\u4e0b\u4e00\u5e74 ), \u8be5\u51fd\u6570\u7684\u7ed3\u679c\u5b9e\u4e0d\u53ef\u9760\u7684\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}