{"id":540,"date":"2008-10-13T00:00:00","date_gmt":"2008-10-12T16:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=540"},"modified":"2011-07-15T09:44:07","modified_gmt":"2011-07-15T01:44:07","slug":"mysql%e6%97%a5%e6%9c%9f%e5%92%8c%e6%97%b6%e9%97%b4%e5%87%bd%e6%95%b0%e4%b8%8d%e6%b1%82%e4%ba%ba","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=540","title":{"rendered":"Mysql\u65e5\u671f\u548c\u65f6\u95f4\u51fd\u6570\u4e0d\u6c42\u4eba"},"content":{"rendered":"<p>\u5bf9\u4e8e\u6bcf\u4e2a\u7c7b\u578b\u62e5\u6709\u7684\u503c\u8303\u56f4\u4ee5\u53ca\u5e76\u4e14\u6307\u5b9a\u65e5\u671f\u4f55\u65f6\u95f4\u503c\u7684\u6709\u6548\u683c\u5f0f\u7684\u63cf\u8ff0\u89c17.3.6&nbsp;\u65e5\u671f\u548c\u65f6\u95f4\u7c7b\u578b\u3002&nbsp; <BR><BR>\u8fd9\u91cc\u662f\u4e00\u4e2a\u4f7f\u7528\u65e5\u671f\u51fd\u6570\u7684\u4f8b\u5b50\u3002\u4e0b\u9762\u7684\u67e5\u8be2\u9009\u62e9\u4e86\u6240\u6709\u8bb0\u5f55\uff0c\u5176date_col\u7684\u503c\u662f\u5728\u6700\u540e30\u5929\u4ee5\u5185\uff1a&nbsp; <BR><BR>mysql&gt;&nbsp;SELECT&nbsp;something&nbsp;FROM&nbsp;table&nbsp; <BR>WHERE&nbsp;TO_DAYS(NOW())&nbsp;&#8211;&nbsp;TO_DAYS(date_col)&nbsp;&lt;=&nbsp;30;&nbsp; <BR><BR>DAYOFWEEK(date)&nbsp; <BR>\u8fd4\u56de\u65e5\u671fdate\u7684\u661f\u671f\u7d22\u5f15(1=\u661f\u671f\u5929\uff0c2=\u661f\u671f\u4e00,&nbsp;\u2026\u20267=\u661f\u671f\u516d)\u3002\u8fd9\u4e9b\u7d22\u5f15\u503c\u5bf9\u5e94\u4e8eODBC\u6807\u51c6\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;DAYOFWEEK(&#8216;1998-02-03&#8217;);&nbsp; <BR>-&gt;&nbsp;3&nbsp; <BR><BR>WEEKDAY(date)&nbsp; <BR>\u8fd4\u56dedate\u7684\u661f\u671f\u7d22\u5f15(0=\u661f\u671f\u4e00\uff0c1=\u661f\u671f\u4e8c,&nbsp;\u2026\u20266=&nbsp;\u661f\u671f\u5929)\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;WEEKDAY(&#8216;1997-10-04&nbsp;22:23:00&#8217;);&nbsp; <BR>-&gt;&nbsp;5&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;WEEKDAY(&#8216;1997-11-05&#8217;);&nbsp; <BR>-&gt;&nbsp;2&nbsp; <BR><BR>DAYOFMONTH(date)&nbsp; <BR>\u8fd4\u56dedate\u7684\u6708\u4efd\u4e2d\u65e5\u671f\uff0c\u57281\u523031\u8303\u56f4\u5185\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;DAYOFMONTH(&#8216;1998-02-03&#8217;);&nbsp; <BR>-&gt;&nbsp;3&nbsp; <BR><BR>DAYOFYEAR(date)&nbsp; <BR>\u8fd4\u56dedate\u5728\u4e00\u5e74\u4e2d\u7684\u65e5\u6570,&nbsp;\u57281\u5230366\u8303\u56f4\u5185\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;DAYOFYEAR(&#8216;1998-02-03&#8217;);&nbsp; <BR>-&gt;&nbsp;34&nbsp; <BR><BR>MONTH(date)&nbsp; <BR>\u8fd4\u56dedate\u7684\u6708\u4efd\uff0c\u8303\u56f41\u523012\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;MONTH(&#8216;1998-02-03&#8217;);&nbsp; <BR>-&gt;&nbsp;2&nbsp; <BR><BR>DAYNAME(date)&nbsp; <BR>\u8fd4\u56dedate\u7684\u661f\u671f\u540d\u5b57\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;DAYNAME(&#8220;1998-02-05&#8221;);&nbsp; <BR>-&gt;&nbsp;&#8216;Thursday&#8217;&nbsp; <BR><BR>MONTHNAME(date)&nbsp; <BR>\u8fd4\u56dedate\u7684\u6708\u4efd\u540d\u5b57\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;MONTHNAME(&#8220;1998-02-05&#8221;);&nbsp; <BR>-&gt;&nbsp;&#8216;February&#8217;&nbsp; <BR><BR>QUARTER(date)&nbsp; <BR>\u8fd4\u56dedate\u4e00\u5e74\u4e2d\u7684\u5b63\u5ea6\uff0c\u8303\u56f41\u52304\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;QUARTER(&#8217;98-04-01&#8242;);&nbsp; <BR>-&gt;&nbsp;2&nbsp; <BR><BR>WEEK(date)&nbsp; <BR>\u3000&nbsp; <BR>WEEK(date,first)&nbsp; <BR>\u5bf9\u4e8e\u661f\u671f\u5929\u662f\u4e00\u5468\u7684\u7b2c\u4e00\u5929\u7684\u5730\u65b9\uff0c\u6709\u4e00\u4e2a\u5355\u4e2a\u53c2\u6570\uff0c\u8fd4\u56dedate\u7684\u5468\u6570\uff0c\u8303\u56f4\u57280\u523052\u30022\u4e2a\u53c2\u6570\u5f62\u5f0fWEEK()\u5141\u8bb8 <BR>\u4f60\u6307\u5b9a\u661f\u671f\u662f\u5426\u5f00\u59cb\u4e8e\u661f\u671f\u5929\u6216\u661f\u671f\u4e00\u3002\u5982\u679c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f0\uff0c\u661f\u671f\u4ece\u661f\u671f\u5929\u5f00\u59cb\uff0c\u5982\u679c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f1\uff0c <BR>\u4ece\u661f\u671f\u4e00\u5f00\u59cb\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;WEEK(&#8216;1998-02-20&#8217;);&nbsp; <BR>-&gt;&nbsp;7&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;WEEK(&#8216;1998-02-20&#8217;,0);&nbsp; <BR>-&gt;&nbsp;7&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;WEEK(&#8216;1998-02-20&#8217;,1);&nbsp; <BR>-&gt;&nbsp;8&nbsp; <BR><BR>YEAR(date)&nbsp; <BR>\u8fd4\u56dedate\u7684\u5e74\u4efd\uff0c\u8303\u56f4\u57281000\u52309999\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;YEAR(&#8217;98-02-03&#8242;);&nbsp; <BR>-&gt;&nbsp;1998&nbsp; <BR><BR>HOUR(time)&nbsp; <BR>\u8fd4\u56detime\u7684\u5c0f\u65f6\uff0c\u8303\u56f4\u662f0\u523023\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;HOUR(&#8217;10:05:03&#8242;);&nbsp; <BR>-&gt;&nbsp;10&nbsp; <BR><BR>MINUTE(time)&nbsp; <BR>\u8fd4\u56detime\u7684\u5206\u949f\uff0c\u8303\u56f4\u662f0\u523059\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;MINUTE(&#8217;98-02-03&nbsp;10:05:03&#8242;);&nbsp; <BR>-&gt;&nbsp;5&nbsp; <BR><BR>SECOND(time)&nbsp; <BR>\u56de\u6765time\u7684\u79d2\u6570\uff0c\u8303\u56f4\u662f0\u523059\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;SECOND(&#8217;10:05:03&#8242;);&nbsp; <BR>-&gt;&nbsp;3&nbsp; <BR><BR>PERIOD_ADD(P,N)&nbsp; <BR>\u589e\u52a0N\u4e2a\u6708\u5230\u9636\u6bb5P\uff08\u4ee5\u683c\u5f0fYYMM\u6216YYYYMM)\u3002\u4ee5\u683c\u5f0fYYYYMM\u8fd4\u56de\u503c\u3002\u6ce8\u610f\u9636\u6bb5\u53c2\u6570P\u4e0d\u662f\u65e5\u671f\u503c\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;PERIOD_ADD(9801,2);&nbsp; <BR>-&gt;&nbsp;199803&nbsp; <BR><BR>PERIOD_DIFF(P1,P2)&nbsp; <BR>\u8fd4\u56de\u5728\u65f6\u671fP1\u548cP2\u4e4b\u95f4\u6708\u6570\uff0cP1\u548cP2\u5e94\u8be5\u4ee5\u683c\u5f0fYYMM\u6216YYYYMM\u3002\u6ce8\u610f\uff0c\u65f6\u671f\u53c2\u6570P1\u548cP2\u4e0d\u662f\u65e5\u671f\u503c\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;PERIOD_DIFF(9802,199703);&nbsp; <BR>-&gt;&nbsp;11&nbsp; <BR><BR>DATE_ADD(date,INTERVAL&nbsp;expr&nbsp;type)&nbsp; <BR>\u3000&nbsp; <BR>DATE_SUB(date,INTERVAL&nbsp;expr&nbsp;type)&nbsp; <BR>\u3000&nbsp; <BR>ADDDATE(date,INTERVAL&nbsp;expr&nbsp;type)&nbsp; <BR>\u3000&nbsp; <BR>SUBDATE(date,INTERVAL&nbsp;expr&nbsp;type)&nbsp; <BR>\u8fd9\u4e9b\u529f\u80fd\u6267\u884c\u65e5\u671f\u8fd0\u7b97\u3002\u5bf9\u4e8eMySQL&nbsp;3.22\uff0c\u4ed6\u4eec\u662f\u65b0\u7684\u3002ADDDATE()\u548cSUBDATE()\u662fDATE_ADD()\u548cDATE_SUB()\u7684\u540c\u4e49\u8bcd\u3002 <BR>\u5728MySQL&nbsp;3.23\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528+\u548c-\u800c\u4e0d\u662fDATE_ADD()\u548cDATE_SUB()\u3002\uff08\u89c1\u4f8b\u5b50\uff09date\u662f\u4e00\u4e2a\u6307\u5b9a\u5f00\u59cb\u65e5\u671f\u7684 <BR>DATETIME\u6216DATE\u503c\uff0cexpr\u662f\u6307\u5b9a\u52a0\u5230\u5f00\u59cb\u65e5\u671f\u6216\u4ece\u5f00\u59cb\u65e5\u671f\u51cf\u53bb\u7684\u95f4\u9694\u503c\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0cexpr\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\uff1b\u5b83\u53ef\u4ee5\u4ee5 <BR>\u4e00\u4e2a\u201c-\u201d\u5f00\u59cb\u8868\u793a\u8d1f\u95f4\u9694\u3002type\u662f\u4e00\u4e2a\u5173\u952e\u8bcd\uff0c\u6307\u660e\u8868\u8fbe\u5f0f\u5e94\u8be5\u5982\u4f55\u88ab\u89e3\u91ca\u3002EXTRACT(type&nbsp;FROM&nbsp;date)\u51fd\u6570\u4ece\u65e5\u671f <BR>\u4e2d\u8fd4\u56de\u201ctype\u201d\u95f4\u9694\u3002\u4e0b\u8868\u663e\u793a\u4e86type\u548cexpr\u53c2\u6570\u600e\u6837\u88ab\u5173\u8054\uff1a&nbsp;type\u503c&nbsp;\u542b\u4e49&nbsp;\u671f\u671b\u7684expr\u683c\u5f0f&nbsp; <BR>SECOND&nbsp;\u79d2&nbsp;SECONDS&nbsp; <BR>MINUTE&nbsp;\u5206\u949f&nbsp;MINUTES&nbsp; <BR>HOUR&nbsp;\u65f6\u95f4&nbsp;HOURS&nbsp; <BR>DAY&nbsp;\u5929&nbsp;DAYS&nbsp; <BR>MONTH&nbsp;\u6708&nbsp;MONTHS&nbsp; <BR>YEAR&nbsp;\u5e74&nbsp;YEARS&nbsp; <BR>MINUTE_SECOND&nbsp;\u5206\u949f\u548c\u79d2&nbsp;&#8220;MINUTES:SECONDS&#8221;&nbsp; <BR>HOUR_MINUTE&nbsp;\u5c0f\u65f6\u548c\u5206\u949f&nbsp;&#8220;HOURS:MINUTES&#8221;&nbsp; <BR>DAY_HOUR&nbsp;\u5929\u548c\u5c0f\u65f6&nbsp;&#8220;DAYS&nbsp;HOURS&#8221;&nbsp; <BR>YEAR_MONTH&nbsp;\u5e74\u548c\u6708&nbsp;&#8220;YEARS-MONTHS&#8221;&nbsp; <BR>HOUR_SECOND&nbsp;\u5c0f\u65f6,&nbsp;\u5206\u949f\uff0c&nbsp;&#8220;HOURS:MINUTES:SECONDS&#8221;&nbsp; <BR>DAY_MINUTE&nbsp;\u5929,&nbsp;\u5c0f\u65f6,&nbsp;\u5206\u949f&nbsp;&#8220;DAYS&nbsp;HOURS:MINUTES&#8221;&nbsp; <BR>DAY_SECOND&nbsp;\u5929,&nbsp;\u5c0f\u65f6,&nbsp;\u5206\u949f,&nbsp;\u79d2&nbsp;&#8220;DAYS&nbsp;HOURS:MINUTES:SECONDS&#8221;&nbsp; <BR><BR>MySQL\u5728expr\u683c\u5f0f\u4e2d\u5141\u8bb8\u4efb\u4f55\u6807\u70b9\u5206\u9694\u7b26\u3002\u8868\u793a\u663e\u793a\u7684\u662f\u5efa\u8bae\u7684\u5206\u9694\u7b26\u3002\u5982\u679cdate\u53c2\u6570\u662f\u4e00\u4e2aDATE\u503c\u5e76\u4e14\u4f60\u7684\u8ba1\u7b97\u4ec5\u4ec5 <BR>\u5305\u542bYEAR\u3001MONTH\u548cDAY\u90e8\u5206(\u5373\uff0c\u6ca1\u6709\u65f6\u95f4\u90e8\u5206)\uff0c\u7ed3\u679c\u662f\u4e00\u4e2aDATE\u503c\u3002\u5426\u5219\u7ed3\u679c\u662f\u4e00\u4e2aDATETIME\u503c\u3002&nbsp; <BR><BR>mysql&gt;&nbsp;SELECT&nbsp;&#8220;1997-12-31&nbsp;23:59:59&#8221;&nbsp;+&nbsp;INTERVAL&nbsp;1&nbsp;SECOND;&nbsp; <BR>-&gt;&nbsp;1998-01-01&nbsp;00:00:00&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;INTERVAL&nbsp;1&nbsp;DAY&nbsp;+&nbsp;&#8220;1997-12-31&#8221;;&nbsp; <BR>-&gt;&nbsp;1998-01-01&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;&#8220;1998-01-01&#8221;&nbsp;&#8211;&nbsp;INTERVAL&nbsp;1&nbsp;SECOND;&nbsp; <BR>-&gt;&nbsp;1997-12-31&nbsp;23:59:59&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;DATE_ADD(&#8220;1997-12-31&nbsp;23:59:59&#8221;,&nbsp; <BR>INTERVAL&nbsp;1&nbsp;SECOND);&nbsp; <BR>-&gt;&nbsp;1998-01-01&nbsp;00:00:00&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;DATE_ADD(&#8220;1997-12-31&nbsp;23:59:59&#8221;,&nbsp; <BR>INTERVAL&nbsp;1&nbsp;DAY);&nbsp; <BR>-&gt;&nbsp;1998-01-01&nbsp;23:59:59&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;DATE_ADD(&#8220;1997-12-31&nbsp;23:59:59&#8221;,&nbsp; <BR>INTERVAL&nbsp;&#8220;1:1&#8221;&nbsp;MINUTE_SECOND);&nbsp; <BR>-&gt;&nbsp;1998-01-01&nbsp;00:01:00&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;DATE_SUB(&#8220;1998-01-01&nbsp;00:00:00&#8221;,&nbsp; <BR>INTERVAL&nbsp;&#8220;1&nbsp;1:1:1&#8221;&nbsp;DAY_SECOND);&nbsp; <BR>-&gt;&nbsp;1997-12-30&nbsp;22:58:59&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;DATE_ADD(&#8220;1998-01-01&nbsp;00:00:00&#8221;,&nbsp; <BR>INTERVAL&nbsp;&#8220;-1&nbsp;10&#8221;&nbsp;DAY_HOUR);&nbsp; <BR>-&gt;&nbsp;1997-12-30&nbsp;14:00:00&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;DATE_SUB(&#8220;1998-01-02&#8221;,&nbsp;INTERVAL&nbsp;31&nbsp;DAY);&nbsp; <BR>-&gt;&nbsp;1997-12-02&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;EXTRACT(YEAR&nbsp;FROM&nbsp;&#8220;1999-07-02&#8221;);&nbsp; <BR>-&gt;&nbsp;1999&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;EXTRACT(YEAR_MONTH&nbsp;FROM&nbsp;&#8220;1999-07-02&nbsp;01:02:03&#8221;);&nbsp; <BR>-&gt;&nbsp;199907&nbsp; <BR>mysql&gt;&nbsp;SELECT&nbsp;EXTRACT(DAY_MINUTE&nbsp;FROM&nbsp;&#8220;1999-07-02&nbsp;01:02:03&#8221;);&nbsp; <BR>-&gt;&nbsp;20102&nbsp; <BR><BR>\u5982\u679c\u4f60\u6307\u5b9a\u592a\u77ed\u7684\u95f4\u9694\u503c(\u4e0d\u5305\u62ectype\u5173\u952e\u8bcd\u671f\u671b\u7684\u95f4\u9694\u90e8\u5206)\uff0cMySQL\u5047\u8bbe\u4f60\u7701\u6389\u4e86\u95f4\u9694\u503c\u7684\u6700\u5de6\u9762\u90e8\u5206\u3002\u4f8b\u5982\uff0c <BR>\u5982\u679c\u4f60\u6307\u5b9a\u4e00\u4e2atype\u662fDAY_SECOND\uff0c\u503cexpr\u88ab\u5e0c\u671b\u6709\u5929\u3001\u5c0f\u65f6\u3001\u5206\u949f\u548c\u79d2\u90e8\u5206\u3002\u5982\u679c\u4f60\u8c61&#8221;1:10&#8243;\u8fd9\u6837\u6307\u5b9a\u503c\uff0c <BR>MySQL\u5047\u8bbe\u65e5\u5b50\u548c\u5c0f\u65f6\u90e8\u5206\u662f\u4e22\u5931\u7684\u5e76\u4e14\u503c\u4ee3\u8868\u5206\u949f\u548c\u79d2\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c&#8221;1:10&#8243;&nbsp;DAY_SECOND\u4ee5\u5b83\u7b49\u4ef7\u4e8e&#8221;1:10&#8243;&nbsp;MINUTE_SECOND <BR>\u7684\u65b9\u5f0f\u89e3\u91ca\uff0c\u8fd9\u5bf9\u90a3MySQL\u89e3\u91caTIME\u503c\u8868\u793a\u7ecf\u8fc7\u7684\u65f6\u95f4\u800c\u975e\u4f5c\u4e3a\u4e00\u5929\u7684\u65f6\u95f4\u7684\u65b9\u5f0f\u6709\u4e8c\u4e49\u6027\u3002\u5982\u679c\u4f60\u4f7f\u7528\u786e\u5b9e\u4e0d\u6b63\u786e\u7684\u65e5\u671f\uff0c <BR>\u7ed3\u679c\u662fNULL\u3002\u5982\u679c\u4f60\u589e\u52a0MONTH\u3001YEAR_MONTH\u6216YEAR\u5e76\u4e14\u7ed3\u679c\u65e5\u671f\u5927\u4e8e\u65b0\u6708\u4efd\u7684\u6700\u5927\u503c\u5929\u6570\uff0c\u65e5\u5b50\u5728\u65b0\u6708\u7528\u6700\u5927\u7684\u5929\u8c03\u6574\u3002&nbsp; <BR><BR>mysql&gt;&nbsp;select&nbsp;DATE_ADD(&#8216;1998-01-30&#8217;,&nbsp;Interval&nbsp;1&nbsp;month);&nbsp; <BR>-&gt;&nbsp;1998-02-28&nbsp; <BR><BR>\u6ce8\u610f\uff0c\u4ece\u524d\u9762\u7684\u4f8b\u5b50\u4e2d\u8bcdINTERVAL\u548ctype\u5173\u952e\u8bcd\u4e0d\u662f\u533a\u5206\u5927\u5c0f\u5199\u7684\u3002&nbsp; <BR>TO_DAYS(date)&nbsp; <BR>\u7ed9\u51fa\u4e00\u4e2a\u65e5\u671fdate\uff0c\u8fd4\u56de\u4e00\u4e2a\u5929\u6570(\u4ece0\u5e74\u7684\u5929\u6570)\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;TO_DAYS(950501);&nbsp; <BR>-&gt;&nbsp;728779&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;TO_DAYS(&#8216;1997-10-07&#8217;);&nbsp; <BR>-&gt;&nbsp;729669&nbsp; <BR><BR>TO_DAYS()\u4e0d\u6253\u7b97\u7528\u4e8e\u4f7f\u7528\u683c\u5217\u9ad8\u91cc\u5386(1582)\u51fa\u73b0\u524d\u7684\u503c\u3002&nbsp; <BR><BR>FROM_DAYS(N)&nbsp; <BR>\u7ed9\u51fa\u4e00\u4e2a\u5929\u6570N\uff0c\u8fd4\u56de\u4e00\u4e2aDATE\u503c\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;FROM_DAYS(729669);&nbsp; <BR>-&gt;&nbsp;&#8216;1997-10-07&#8217;&nbsp; <BR><BR>TO_DAYS()\u4e0d\u6253\u7b97\u7528\u4e8e\u4f7f\u7528\u683c\u5217\u9ad8\u91cc\u5386(1582)\u51fa\u73b0\u524d\u7684\u503c\u3002&nbsp; <BR><BR>DATE_FORMAT(date,format)&nbsp; <BR>\u6839\u636eformat\u5b57\u7b26\u4e32\u683c\u5f0f\u5316date\u503c\u3002\u4e0b\u5217\u4fee\u9970\u7b26\u53ef\u4ee5\u88ab\u7528\u5728format\u5b57\u7b26\u4e32\u4e2d\uff1a&nbsp;%M&nbsp;\u6708\u540d\u5b57(January\u2026\u2026December)&nbsp; <BR>%W&nbsp;\u661f\u671f\u540d\u5b57(Sunday\u2026\u2026Saturday)&nbsp; <BR>%D&nbsp;\u6709\u82f1\u8bed\u524d\u7f00\u7684\u6708\u4efd\u7684\u65e5\u671f(1st,&nbsp;2nd,&nbsp;3rd,&nbsp;\u7b49\u7b49\u3002\uff09&nbsp; <BR>%Y&nbsp;\u5e74,&nbsp;\u6570\u5b57,&nbsp;4&nbsp;\u4f4d&nbsp; <BR>%y&nbsp;\u5e74,&nbsp;\u6570\u5b57,&nbsp;2&nbsp;\u4f4d&nbsp; <BR>%a&nbsp;\u7f29\u5199\u7684\u661f\u671f\u540d\u5b57(Sun\u2026\u2026Sat)&nbsp; <BR>%d&nbsp;\u6708\u4efd\u4e2d\u7684\u5929\u6570,&nbsp;\u6570\u5b57(00\u2026\u202631)&nbsp; <BR>%e&nbsp;\u6708\u4efd\u4e2d\u7684\u5929\u6570,&nbsp;\u6570\u5b57(0\u2026\u202631)&nbsp; <BR>%m&nbsp;\u6708,&nbsp;\u6570\u5b57(01\u2026\u202612)&nbsp; <BR>%c&nbsp;\u6708,&nbsp;\u6570\u5b57(1\u2026\u202612)&nbsp; <BR>%b&nbsp;\u7f29\u5199\u7684\u6708\u4efd\u540d\u5b57(Jan\u2026\u2026Dec)&nbsp; <BR>%j&nbsp;\u4e00\u5e74\u4e2d\u7684\u5929\u6570(001\u2026\u2026366)&nbsp; <BR>%H&nbsp;\u5c0f\u65f6(00\u2026\u202623)&nbsp; <BR>%k&nbsp;\u5c0f\u65f6(0\u2026\u202623)&nbsp; <BR>%h&nbsp;\u5c0f\u65f6(01\u2026\u202612)&nbsp; <BR>%I&nbsp;\u5c0f\u65f6(01\u2026\u202612)&nbsp; <BR>%l&nbsp;\u5c0f\u65f6(1\u2026\u202612)&nbsp; <BR>%i&nbsp;\u5206\u949f,&nbsp;\u6570\u5b57(00\u2026\u202659)&nbsp; <BR>%r&nbsp;\u65f6\u95f4,12&nbsp;\u5c0f\u65f6(hh:mm:ss&nbsp;[AP]M)&nbsp; <BR>%T&nbsp;\u65f6\u95f4,24&nbsp;\u5c0f\u65f6(hh:mm:ss)&nbsp; <BR>%S&nbsp;\u79d2(00\u2026\u202659)&nbsp; <BR>%s&nbsp;\u79d2(00\u2026\u202659)&nbsp; <BR>%p&nbsp;AM\u6216PM&nbsp; <BR>%w&nbsp;\u4e00\u4e2a\u661f\u671f\u4e2d\u7684\u5929\u6570(0=Sunday&nbsp;\u2026\u20266=Saturday&nbsp;\uff09&nbsp; <BR>%U&nbsp;\u661f\u671f(0\u2026\u202652),&nbsp;\u8fd9\u91cc\u661f\u671f\u5929\u662f\u661f\u671f\u7684\u7b2c\u4e00\u5929&nbsp; <BR>%u&nbsp;\u661f\u671f(0\u2026\u202652),&nbsp;\u8fd9\u91cc\u661f\u671f\u4e00\u662f\u661f\u671f\u7684\u7b2c\u4e00\u5929&nbsp; <BR>%%&nbsp;\u4e00\u4e2a\u6587\u5b57\u201c%\u201d\u3002&nbsp; <BR><BR>\u6240\u6709\u7684\u5176\u4ed6\u5b57\u7b26\u4e0d\u505a\u89e3\u91ca\u88ab\u590d\u5236\u5230\u7ed3\u679c\u4e2d\u3002&nbsp; <BR><BR>mysql&gt;&nbsp;select&nbsp;DATE_FORMAT(&#8216;1997-10-04&nbsp;22:23:00&#8217;,&nbsp;&#8216;%W&nbsp;%M&nbsp;%Y&#8217;);&nbsp; <BR>-&gt;&nbsp;&#8216;Saturday&nbsp;October&nbsp;1997&#8217;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;DATE_FORMAT(&#8216;1997-10-04&nbsp;22:23:00&#8217;,&nbsp;&#8216;%H:%i:%s&#8217;);&nbsp; <BR>-&gt;&nbsp;&#8217;22:23:00&#8242;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;DATE_FORMAT(&#8216;1997-10-04&nbsp;22:23:00&#8217;,&nbsp; <BR>&#8216;%D&nbsp;%y&nbsp;%a&nbsp;%d&nbsp;%m&nbsp;%b&nbsp;%j&#8217;);&nbsp; <BR>-&gt;&nbsp;&#8216;4th&nbsp;97&nbsp;Sat&nbsp;04&nbsp;10&nbsp;Oct&nbsp;277&#8217;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;DATE_FORMAT(&#8216;1997-10-04&nbsp;22:23:00&#8217;,&nbsp; <BR>&#8216;%H&nbsp;%k&nbsp;%I&nbsp;%r&nbsp;%T&nbsp;%S&nbsp;%w&#8217;);&nbsp; <BR>-&gt;&nbsp;&#8217;22&nbsp;22&nbsp;10&nbsp;10:23:00&nbsp;PM&nbsp;22:23:00&nbsp;00&nbsp;6&#8242;&nbsp; <BR>MySQL3.23\u4e2d\uff0c\u5728\u683c\u5f0f\u4fee\u9970\u7b26\u5b57\u7b26\u524d\u9700\u8981%\u3002\u5728MySQL\u66f4\u65e9\u7684\u7248\u672c\u4e2d\uff0c%\u662f\u53ef\u9009\u7684\u3002&nbsp; <BR><BR>TIME_FORMAT(time,format)&nbsp; <BR>\u8fd9\u8c61\u4e0a\u9762\u7684DATE_FORMAT()\u51fd\u6570\u4e00\u6837\u4f7f\u7528\uff0c\u4f46\u662fformat\u5b57\u7b26\u4e32\u53ea\u80fd\u5305\u542b\u5904\u7406\u5c0f\u65f6\u3001\u5206\u949f\u548c\u79d2\u7684\u90a3\u4e9b\u683c\u5f0f\u4fee\u9970\u7b26\u3002 <BR>\u5176\u4ed6\u4fee\u9970\u7b26\u4ea7\u751f\u4e00\u4e2aNULL\u503c\u62160\u3002&nbsp; <BR>CURDATE()&nbsp; <BR>\u3000&nbsp; <BR>CURRENT_DATE&nbsp; <BR>\u4ee5&#8217;YYYY-MM-DD&#8217;\u6216YYYYMMDD\u683c\u5f0f\u8fd4\u56de\u4eca\u5929\u65e5\u671f\u503c\uff0c\u53d6\u51b3\u4e8e\u51fd\u6570\u662f\u5728\u4e00\u4e2a\u5b57\u7b26\u4e32\u8fd8\u662f\u6570\u5b57\u4e0a\u4e0b\u6587\u88ab\u4f7f\u7528\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;CURDATE();&nbsp; <BR>-&gt;&nbsp;&#8216;1997-12-15&#8217;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;CURDATE()&nbsp;+&nbsp;0;&nbsp; <BR>-&gt;&nbsp;19971215&nbsp; <BR><BR>CURTIME()&nbsp; <BR>\u3000&nbsp; <BR>CURRENT_TIME&nbsp; <BR>\u4ee5&#8217;HH:MM:SS&#8217;\u6216HHMMSS\u683c\u5f0f\u8fd4\u56de\u5f53\u524d\u65f6\u95f4\u503c\uff0c\u53d6\u51b3\u4e8e\u51fd\u6570\u662f\u5728\u4e00\u4e2a\u5b57\u7b26\u4e32\u8fd8\u662f\u5728\u6570\u5b57\u7684\u4e0a\u4e0b\u6587\u88ab\u4f7f\u7528\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;CURTIME();&nbsp; <BR>-&gt;&nbsp;&#8217;23:50:26&#8242;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;CURTIME()&nbsp;+&nbsp;0;&nbsp; <BR>-&gt;&nbsp;235026&nbsp; <BR><BR>NOW()&nbsp; <BR>\u3000&nbsp; <BR>SYSDATE()&nbsp; <BR>\u3000&nbsp; <BR>CURRENT_TIMESTAMP&nbsp; <BR>\u4ee5&#8217;YYYY-MM-DD&nbsp;HH:MM:SS&#8217;\u6216YYYYMMDDHHMMSS\u683c\u5f0f\u8fd4\u56de\u5f53\u524d\u7684\u65e5\u671f\u548c\u65f6\u95f4\uff0c\u53d6\u51b3\u4e8e\u51fd\u6570\u662f\u5728\u4e00\u4e2a\u5b57\u7b26\u4e32\u8fd8\u662f\u5728\u6570\u5b57\u7684 <BR>\u4e0a\u4e0b\u6587\u88ab\u4f7f\u7528\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;NOW();&nbsp; <BR>-&gt;&nbsp;&#8216;1997-12-15&nbsp;23:50:26&#8217;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;NOW()&nbsp;+&nbsp;0;&nbsp; <BR>-&gt;&nbsp;19971215235026&nbsp; <BR><BR>UNIX_TIMESTAMP()&nbsp; <BR>\u3000&nbsp; <BR>UNIX_TIMESTAMP(date)&nbsp; <BR>\u5982\u679c\u6ca1\u6709\u53c2\u6570\u8c03\u7528\uff0c\u8fd4\u56de\u4e00\u4e2aUnix\u65f6\u95f4\u6233\u8bb0(\u4ece&#8217;1970-01-01&nbsp;00:00:00&#8217;GMT\u5f00\u59cb\u7684\u79d2\u6570)\u3002\u5982\u679cUNIX_TIMESTAMP()\u7528\u4e00 <BR>\u4e2adate\u53c2\u6570\u88ab\u8c03\u7528\uff0c\u5b83\u8fd4\u56de\u4ece&#8217;1970-01-01&nbsp;00:00:00&#8242;&nbsp;GMT\u5f00\u59cb\u7684\u79d2\u6570\u503c\u3002date\u53ef\u4ee5\u662f\u4e00\u4e2aDATE\u5b57\u7b26\u4e32\u3001\u4e00\u4e2aDATETIME <BR>\u5b57\u7b26\u4e32\u3001\u4e00\u4e2aTIMESTAMP\u6216\u4ee5YYMMDD\u6216YYYYMMDD\u683c\u5f0f\u7684\u672c\u5730\u65f6\u95f4\u7684\u4e00\u4e2a\u6570\u5b57\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;UNIX_TIMESTAMP();&nbsp; <BR>-&gt;&nbsp;882226357&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;UNIX_TIMESTAMP(&#8216;1997-10-04&nbsp;22:23:00&#8217;);&nbsp; <BR>-&gt;&nbsp;875996580&nbsp; <BR><BR>\u5f53UNIX_TIMESTAMP\u88ab\u7528\u4e8e\u4e00\u4e2aTIMESTAMP\u5217\uff0c\u51fd\u6570\u5c06\u76f4\u63a5\u63a5\u53d7\u503c\uff0c\u6ca1\u6709\u9690\u542b\u7684\u201cstring-to-unix-timestamp\u201d\u53d8\u6362\u3002&nbsp; <BR><BR>FROM_UNIXTIME(unix_timestamp)&nbsp; <BR>\u4ee5&#8217;YYYY-MM-DD&nbsp;HH:MM:SS&#8217;\u6216YYYYMMDDHHMMSS\u683c\u5f0f\u8fd4\u56deunix_timestamp\u53c2\u6570\u6240\u8868\u793a\u7684\u503c\uff0c\u53d6\u51b3\u4e8e\u51fd\u6570\u662f\u5728\u4e00\u4e2a\u5b57\u7b26\u4e32 <BR>\u8fd8\u662f\u6216\u6570\u5b57\u4e0a\u4e0b\u6587\u4e2d\u88ab\u4f7f\u7528\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;FROM_UNIXTIME(875996580);&nbsp; <BR>-&gt;&nbsp;&#8216;1997-10-04&nbsp;22:23:00&#8217;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;FROM_UNIXTIME(875996580)&nbsp;+&nbsp;0;&nbsp; <BR>-&gt;&nbsp;19971004222300&nbsp; <BR><BR>FROM_UNIXTIME(unix_timestamp,format)&nbsp; <BR>\u8fd4\u56de\u8868\u793a&nbsp;Unix&nbsp;\u65f6\u95f4\u6807\u8bb0\u7684\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u6839\u636eformat\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3002format\u53ef\u4ee5\u5305\u542b\u4e0eDATE_FORMAT()\u51fd\u6570\u5217\u51fa\u7684\u6761 <BR>\u76ee\u540c\u6837\u7684\u4fee\u9970\u7b26\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;FROM_UNIXTIME(UNIX_TIMESTAMP(),&nbsp; <BR>&#8216;%Y&nbsp;%D&nbsp;%M&nbsp;%h:%i:%s&nbsp;%x&#8217;);&nbsp; <BR>-&gt;&nbsp;&#8216;1997&nbsp;23rd&nbsp;December&nbsp;03:43:30&nbsp;x&#8217;&nbsp; <BR><BR>SEC_TO_TIME(seconds)&nbsp; <BR>\u8fd4\u56deseconds\u53c2\u6570\uff0c\u53d8\u6362\u6210\u5c0f\u65f6\u3001\u5206\u949f\u548c\u79d2\uff0c\u503c\u4ee5&#8217;HH:MM:SS&#8217;\u6216HHMMSS\u683c\u5f0f\u5316\uff0c\u53d6\u51b3\u4e8e\u51fd\u6570\u662f\u5728\u4e00\u4e2a\u5b57\u7b26\u4e32\u8fd8\u662f\u5728\u6570\u5b57 <BR>\u4e0a\u4e0b\u6587\u4e2d\u88ab\u4f7f\u7528\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;SEC_TO_TIME(2378);&nbsp; <BR>-&gt;&nbsp;&#8217;00:39:38&#8242;&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;SEC_TO_TIME(2378)&nbsp;+&nbsp;0;&nbsp; <BR>-&gt;&nbsp;3938&nbsp; <BR><BR>TIME_TO_SEC(time)&nbsp; <BR>\u8fd4\u56detime\u53c2\u6570\uff0c\u8f6c\u6362\u6210\u79d2\u3002&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;TIME_TO_SEC(&#8217;22:23:00&#8242;);&nbsp; <BR>-&gt;&nbsp;80580&nbsp; <BR>mysql&gt;&nbsp;select&nbsp;TIME_TO_SEC(&#8217;00:39:38&#8242;);&nbsp; <BR>-&gt;&nbsp;2378<br \/>\n<DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bf9\u4e8e\u6bcf\u4e2a\u7c7b\u578b\u62e5\u6709\u7684\u503c\u8303\u56f4\u4ee5\u53ca\u5e76\u4e14\u6307\u5b9a\u65e5\u671f\u4f55\u65f6\u95f4\u503c\u7684\u6709\u6548\u683c\u5f0f\u7684\u63cf\u8ff0\u89c17.3.6&nbsp;\u65e5\u671f\u548c\u65f6\u95f4\u7c7b\u578b\u3002&nbsp; \u8fd9\u91cc\u662f\u4e00\u4e2a\u4f7f\u7528\u65e5\u671f\u51fd\u6570\u7684\u4f8b\u5b50\u3002\u4e0b\u9762\u7684\u67e5\u8be2\u9009\u62e9\u4e86\u6240\u6709\u8bb0\u5f55\uff0c\u5176date_col\u7684\u503c\u662f\u5728\u6700\u540e30\u5929\u4ee5\u5185\uff1a&nbsp; mysql&gt;&nbsp;SELECT&nbsp;something&nbsp;FROM&nbsp;table&nbsp; WHERE&nbsp;TO_DAYS(NOW())&nbsp;&#8211;&nbsp;TO_DAYS(date_col)&nbsp;&lt;=&nbsp;30;&nbsp; DAYOFWEEK(date)&nbsp; \u8fd4\u56de\u65e5\u671fdate\u7684\u661f\u671f\u7d22\u5f15(1=\u661f\u671f\u5929\uff0c2=\u661f\u671f\u4e00,&nbsp;\u2026\u20267=\u661f\u671f\u516d)\u3002\u8fd9\u4e9b\u7d22\u5f15\u503c\u5bf9\u5e94\u4e8eODBC\u6807\u51c6\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;DAYOFWEEK(&#8216;1998-02-03&#8217;);&nbsp; -&gt;&nbsp;3&nbsp; WEEKDAY(date)&nbsp; \u8fd4\u56dedate\u7684\u661f\u671f\u7d22\u5f15(0=\u661f\u671f\u4e00\uff0c1=\u661f\u671f\u4e8c,&nbsp;\u2026\u20266=&nbsp;\u661f\u671f\u5929)\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;WEEKDAY(&#8216;1997-10-04&nbsp;22:23:00&#8217;);&nbsp; -&gt;&nbsp;5&nbsp; mysql&gt;&nbsp;select&nbsp;WEEKDAY(&#8216;1997-11-05&#8217;);&nbsp; -&gt;&nbsp;2&nbsp; DAYOFMONTH(date)&nbsp; \u8fd4\u56dedate\u7684\u6708\u4efd\u4e2d\u65e5\u671f\uff0c\u57281\u523031\u8303\u56f4\u5185\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;DAYOFMONTH(&#8216;1998-02-03&#8217;);&nbsp; -&gt;&nbsp;3&nbsp; DAYOFYEAR(date)&nbsp; \u8fd4\u56dedate\u5728\u4e00\u5e74\u4e2d\u7684\u65e5\u6570,&nbsp;\u57281\u5230366\u8303\u56f4\u5185\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;DAYOFYEAR(&#8216;1998-02-03&#8217;);&nbsp; -&gt;&nbsp;34&nbsp; MONTH(date)&nbsp; \u8fd4\u56dedate\u7684\u6708\u4efd\uff0c\u8303\u56f41\u523012\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;MONTH(&#8216;1998-02-03&#8217;);&nbsp; -&gt;&nbsp;2&nbsp; DAYNAME(date)&nbsp; \u8fd4\u56dedate\u7684\u661f\u671f\u540d\u5b57\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;DAYNAME(&#8220;1998-02-05&#8221;);&nbsp; -&gt;&nbsp;&#8216;Thursday&#8217;&nbsp; MONTHNAME(date)&nbsp; \u8fd4\u56dedate\u7684\u6708\u4efd\u540d\u5b57\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;MONTHNAME(&#8220;1998-02-05&#8221;);&nbsp; -&gt;&nbsp;&#8216;February&#8217;&nbsp; QUARTER(date)&nbsp; \u8fd4\u56dedate\u4e00\u5e74\u4e2d\u7684\u5b63\u5ea6\uff0c\u8303\u56f41\u52304\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;QUARTER(&#8217;98-04-01&#8242;);&nbsp; -&gt;&nbsp;2&nbsp; WEEK(date)&nbsp; \u3000&nbsp; WEEK(date,first)&nbsp; \u5bf9\u4e8e\u661f\u671f\u5929\u662f\u4e00\u5468\u7684\u7b2c\u4e00\u5929\u7684\u5730\u65b9\uff0c\u6709\u4e00\u4e2a\u5355\u4e2a\u53c2\u6570\uff0c\u8fd4\u56dedate\u7684\u5468\u6570\uff0c\u8303\u56f4\u57280\u523052\u30022\u4e2a\u53c2\u6570\u5f62\u5f0fWEEK()\u5141\u8bb8 \u4f60\u6307\u5b9a\u661f\u671f\u662f\u5426\u5f00\u59cb\u4e8e\u661f\u671f\u5929\u6216\u661f\u671f\u4e00\u3002\u5982\u679c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f0\uff0c\u661f\u671f\u4ece\u661f\u671f\u5929\u5f00\u59cb\uff0c\u5982\u679c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f1\uff0c \u4ece\u661f\u671f\u4e00\u5f00\u59cb\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;WEEK(&#8216;1998-02-20&#8217;);&nbsp; -&gt;&nbsp;7&nbsp; mysql&gt;&nbsp;select&nbsp;WEEK(&#8216;1998-02-20&#8217;,0);&nbsp; -&gt;&nbsp;7&nbsp; mysql&gt;&nbsp;select&nbsp;WEEK(&#8216;1998-02-20&#8217;,1);&nbsp; -&gt;&nbsp;8&nbsp; YEAR(date)&nbsp; \u8fd4\u56dedate\u7684\u5e74\u4efd\uff0c\u8303\u56f4\u57281000\u52309999\u3002&nbsp; mysql&gt;&nbsp;select&nbsp;YEAR(&#8217;98-02-03&#8242;);&nbsp; -&gt;&nbsp;1998&nbsp; HOUR(time)&nbsp; &hellip; <a href=\"https:\/\/www.strongd.net\/?p=540\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Mysql\u65e5\u671f\u548c\u65f6\u95f4\u51fd\u6570\u4e0d\u6c42\u4eba<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[112],"class_list":["post-540","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-112"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=540"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/540\/revisions"}],"predecessor-version":[{"id":892,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/540\/revisions\/892"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}