{"id":1136991,"date":"2025-01-08T21:42:48","date_gmt":"2025-01-08T13:42:48","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1136991.html"},"modified":"2025-01-08T21:42:51","modified_gmt":"2025-01-08T13:42:51","slug":"python%e5%a6%82%e4%bd%95%e5%b0%86%e5%ad%97%e7%ac%a6%e4%b8%b2%e8%bd%ac%e6%8d%a2%e4%b8%ba%e6%97%b6%e9%97%b4","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1136991.html","title":{"rendered":"python\u5982\u4f55\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25100942\/2677ad28-3eb0-4a2b-8306-476ae8676dff.webp\" alt=\"python\u5982\u4f55\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\" \/><\/p>\n<p><p> <strong>Python\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\u7684\u65b9\u6cd5\u4e3b\u8981\u6709\u4e09\u79cd\uff1a\u4f7f\u7528<code>datetime<\/code>\u6a21\u5757\u3001\u4f7f\u7528<code>time<\/code>\u6a21\u5757\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<code>dateutil<\/code>\u3002<\/strong> \u5176\u4e2d\uff0c<code>datetime<\/code>\u6a21\u5757\u662f\u6700\u5e38\u7528\u4e14\u529f\u80fd\u5f3a\u5927\u7684\u4e00\u4e2a\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>datetime.strptime<\/code>\u65b9\u6cd5\u6765\u8fdb\u884c\u8f6c\u6362\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528\u8fd9\u4e09\u79cd\u65b9\u6cd5\u6765\u5b9e\u73b0\u5b57\u7b26\u4e32\u5230\u65f6\u95f4\u7684\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528<code>datetime<\/code>\u6a21\u5757<\/h3>\n<\/p>\n<p><h4>1\u3001<code>datetime.strptime<\/code> \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p><code>datetime<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u4e00\u4e2a\u540d\u4e3a<code>strptime<\/code>\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a<code>datetime<\/code>\u5bf9\u8c61\u3002<code>strptime<\/code>\u65b9\u6cd5\u9700\u8981\u4e24\u4e2a\u53c2\u6570\uff1a\u8981\u8f6c\u6362\u7684\u5b57\u7b26\u4e32\u548c\u76f8\u5e94\u7684\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u65e5\u671f\u5b57\u7b26\u4e32\u201c2023-10-01 14:30:00\u201d\uff0c\u4f60\u53ef\u4ee5\u5c06\u5b83\u8f6c\u6362\u4e3a<code>datetime<\/code>\u5bf9\u8c61\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<p>date_string = &quot;2023-10-01 14:30:00&quot;<\/p>\n<p>date_format = &quot;%Y-%m-%d %H:%M:%S&quot;<\/p>\n<p>date_object = datetime.strptime(date_string, date_format)<\/p>\n<p>print(date_object)  # \u8f93\u51fa: 2023-10-01 14:30:00<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u683c\u5f0f\u5316\u5b57\u7b26\u4e32<\/h4>\n<\/p>\n<p><p>\u5728\u4f7f\u7528<code>strptime<\/code>\u65b9\u6cd5\u65f6\uff0c\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u662f\u5173\u952e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u683c\u5f0f\u5316\u7b26\u53f7\uff1a<\/p>\n<\/p>\n<ul>\n<li><code>%Y<\/code>: \u56db\u4f4d\u6570\u7684\u5e74\u4efd\uff0c\u4f8b\u5982\uff1a2023<\/li>\n<li><code>%m<\/code>: \u6708\u4efd\uff0c01\u523012<\/li>\n<li><code>%d<\/code>: \u65e5\u671f\uff0c01\u523031<\/li>\n<li><code>%H<\/code>: \u5c0f\u65f6\uff0c00\u523023<\/li>\n<li><code>%M<\/code>: \u5206\u949f\uff0c00\u523059<\/li>\n<li><code>%S<\/code>: \u79d2\uff0c00\u523059<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u7ec4\u5408\u8fd9\u4e9b\u7b26\u53f7\uff0c\u53ef\u4ee5\u5904\u7406\u5404\u79cd\u65e5\u671f\u548c\u65f6\u95f4\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u5904\u7406\u4e0d\u540c\u7684\u65f6\u95f4\u683c\u5f0f<\/h4>\n<\/p>\n<p><p>\u5047\u8bbe\u4f60\u6709\u4e0d\u540c\u683c\u5f0f\u7684\u65f6\u95f4\u5b57\u7b26\u4e32\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u4f7f\u7528\u76f8\u5e94\u7684\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u8fdb\u884c\u8f6c\u6362\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<p>date_string_1 = &quot;01-10-2023&quot;<\/p>\n<p>date_format_1 = &quot;%d-%m-%Y&quot;<\/p>\n<p>date_object_1 = datetime.strptime(date_string_1, date_format_1)<\/p>\n<p>date_string_2 = &quot;10\/01\/2023 14:30:00&quot;<\/p>\n<p>date_format_2 = &quot;%m\/%d\/%Y %H:%M:%S&quot;<\/p>\n<p>date_object_2 = datetime.strptime(date_string_2, date_format_2)<\/p>\n<p>print(date_object_1)  # \u8f93\u51fa: 2023-10-01 00:00:00<\/p>\n<p>print(date_object_2)  # \u8f93\u51fa: 2023-10-01 14:30:00<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528<code>time<\/code>\u6a21\u5757<\/h3>\n<\/p>\n<p><p><code>time<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7c7b\u4f3c\u7684\u65b9\u6cd5<code>strptime<\/code>\uff0c\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\u7ed3\u6784<code>time.struct_time<\/code>\u3002\u867d\u7136\u529f\u80fd\u4e0a\u4e0e<code>datetime<\/code>\u6a21\u5757\u76f8\u4f3c\uff0c\u4f46<code>time<\/code>\u6a21\u5757\u7684\u5e94\u7528\u8303\u56f4\u8f83\u7a84\uff0c\u66f4\u9002\u7528\u4e8e\u5904\u7406\u65f6\u95f4\u6233\u3002<\/p>\n<\/p>\n<p><h4>1\u3001<code>time.strptime<\/code> \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<p>date_string = &quot;2023-10-01 14:30:00&quot;<\/p>\n<p>date_format = &quot;%Y-%m-%d %H:%M:%S&quot;<\/p>\n<p>time_struct = time.strptime(date_string, date_format)<\/p>\n<p>print(time_struct)<\/p>\n<h2><strong>\u8f93\u51fa: time.struct_time(tm_year=2023, tm_mon=10, tm_mday=1, tm_hour=14, tm_min=30, tm_sec=0, tm_wday=6, tm_yday=274, tm_isdst=-1)<\/strong><\/h2>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u8f6c\u6362\u4e3a\u65f6\u95f4\u6233<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5c06<code>time.struct_time<\/code>\u5bf9\u8c61\u8f6c\u6362\u4e3a\u65f6\u95f4\u6233\uff0c\u53ef\u4ee5\u4f7f\u7528<code>time.mktime<\/code>\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<p>date_string = &quot;2023-10-01 14:30:00&quot;<\/p>\n<p>date_format = &quot;%Y-%m-%d %H:%M:%S&quot;<\/p>\n<p>time_struct = time.strptime(date_string, date_format)<\/p>\n<p>timestamp = time.mktime(time_struct)<\/p>\n<p>print(timestamp)  # \u8f93\u51fa: \u65f6\u95f4\u6233<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<code>dateutil<\/code><\/h3>\n<\/p>\n<p><p><code>dateutil<\/code>\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u80fd\u591f\u81ea\u52a8\u89e3\u6790\u5404\u79cd\u65e5\u671f\u548c\u65f6\u95f4\u5b57\u7b26\u4e32\u3002\u5b83\u7684<code>parser.parse<\/code>\u65b9\u6cd5\u53ef\u4ee5\u6839\u636e\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u683c\u5f0f\u81ea\u52a8\u8bc6\u522b\u5e76\u8f6c\u6362\u4e3a<code>datetime<\/code>\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5<code>dateutil<\/code>\u5e93<\/h4>\n<\/p>\n<p><p>\u9996\u5148\u9700\u8981\u5b89\u88c5<code>dateutil<\/code>\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install python-dateutil<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528<code>parser.parse<\/code> \u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from dateutil import parser<\/p>\n<p>date_string = &quot;2023-10-01 14:30:00&quot;<\/p>\n<p>date_object = parser.parse(date_string)<\/p>\n<p>print(date_object)  # \u8f93\u51fa: 2023-10-01 14:30:00<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u5904\u7406\u4e0d\u540c\u65f6\u95f4\u683c\u5f0f<\/h4>\n<\/p>\n<p><p><code>dateutil<\/code>\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u80fd\u591f\u5904\u7406\u5404\u79cd\u683c\u5f0f\u7684\u65e5\u671f\u5b57\u7b26\u4e32\uff0c\u800c\u65e0\u9700\u660e\u786e\u6307\u5b9a\u683c\u5f0f\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from dateutil import parser<\/p>\n<p>date_string_1 = &quot;01-10-2023&quot;<\/p>\n<p>date_string_2 = &quot;10\/01\/2023 14:30:00&quot;<\/p>\n<p>date_object_1 = parser.parse(date_string_1)<\/p>\n<p>date_object_2 = parser.parse(date_string_2)<\/p>\n<p>print(date_object_1)  # \u8f93\u51fa: 2023-10-01 00:00:00<\/p>\n<p>print(date_object_2)  # \u8f93\u51fa: 2023-10-01 14:30:00<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u603b\u7ed3\u4e0e\u5bf9\u6bd4<\/h3>\n<\/p>\n<p><h4>1\u3001<code>datetime<\/code>\u6a21\u5757<\/h4>\n<\/p>\n<ul>\n<li><strong>\u4f18\u70b9<\/strong>: \u5185\u7f6e\u6a21\u5757\uff0c\u65e0\u9700\u989d\u5916\u5b89\u88c5\uff0c\u529f\u80fd\u5f3a\u5927\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u65e5\u671f\u65f6\u95f4\u5904\u7406\u9700\u6c42\u3002<\/li>\n<li><strong>\u7f3a\u70b9<\/strong>: \u9700\u8981\u660e\u786e\u6307\u5b9a\u683c\u5f0f\uff0c\u4e0d\u9002\u5408\u5904\u7406\u4e0d\u89c4\u5219\u683c\u5f0f\u7684\u65e5\u671f\u65f6\u95f4\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ul>\n<p><h4>2\u3001<code>time<\/code>\u6a21\u5757<\/h4>\n<\/p>\n<ul>\n<li><strong>\u4f18\u70b9<\/strong>: \u5185\u7f6e\u6a21\u5757\uff0c\u9002\u7528\u4e8e\u5904\u7406\u65f6\u95f4\u6233\u548c\u65f6\u95f4\u7ed3\u6784\u3002<\/li>\n<li><strong>\u7f3a\u70b9<\/strong>: \u529f\u80fd\u76f8\u5bf9\u8f83\u5c11\uff0c\u4e0d\u9002\u5408\u590d\u6742\u7684\u65e5\u671f\u65f6\u95f4\u5904\u7406\u3002<\/li>\n<\/ul>\n<p><h4>3\u3001<code>dateutil<\/code>\u5e93<\/h4>\n<\/p>\n<ul>\n<li><strong>\u4f18\u70b9<\/strong>: \u529f\u80fd\u5f3a\u5927\uff0c\u80fd\u591f\u81ea\u52a8\u89e3\u6790\u5404\u79cd\u683c\u5f0f\u7684\u65e5\u671f\u65f6\u95f4\u5b57\u7b26\u4e32\uff0c\u4f7f\u7528\u65b9\u4fbf\u3002<\/li>\n<li><strong>\u7f3a\u70b9<\/strong>: \u9700\u8981\u989d\u5916\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u3002<\/li>\n<\/ul>\n<p><h3>\u5b9e\u8df5\u5efa\u8bae<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u5efa\u8bae\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002\u5982\u679c\u5904\u7406\u7684\u662f\u6807\u51c6\u683c\u5f0f\u7684\u65e5\u671f\u65f6\u95f4\u5b57\u7b26\u4e32\uff0c<code>datetime<\/code>\u6a21\u5757\u901a\u5e38\u662f\u6700\u4f73\u9009\u62e9\u3002\u5982\u679c\u9700\u8981\u5904\u7406\u590d\u6742\u6216\u4e0d\u89c4\u5219\u683c\u5f0f\u7684\u65e5\u671f\u65f6\u95f4\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528<code>dateutil<\/code>\u5e93\u3002<\/p>\n<\/p>\n<p><h3>\u4ee3\u7801\u793a\u4f8b\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7efc\u5408\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528\u4e0a\u8ff0\u4e09\u79cd\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<p>import time<\/p>\n<p>from dateutil import parser<\/p>\n<h2><strong>\u4f7f\u7528datetime\u6a21\u5757<\/strong><\/h2>\n<p>date_string_1 = &quot;2023-10-01 14:30:00&quot;<\/p>\n<p>date_format = &quot;%Y-%m-%d %H:%M:%S&quot;<\/p>\n<p>date_object_1 = datetime.strptime(date_string_1, date_format)<\/p>\n<h2><strong>\u4f7f\u7528time\u6a21\u5757<\/strong><\/h2>\n<p>time_struct = time.strptime(date_string_1, date_format)<\/p>\n<p>timestamp = time.mktime(time_struct)<\/p>\n<h2><strong>\u4f7f\u7528dateutil\u5e93<\/strong><\/h2>\n<p>date_object_2 = parser.parse(date_string_1)<\/p>\n<p>print(date_object_1)  # \u8f93\u51fa: 2023-10-01 14:30:00<\/p>\n<p>print(time_struct)    # \u8f93\u51fa: time.struct_time(...)<\/p>\n<p>print(timestamp)      # \u8f93\u51fa: \u65f6\u95f4\u6233<\/p>\n<p>print(date_object_2)  # \u8f93\u51fa: 2023-10-01 14:30:00<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\u548c\u793a\u4f8b\uff0c\u76f8\u4fe1\u4f60\u5df2\u7ecf\u80fd\u591f\u719f\u7ec3\u5730\u5c06\u5404\u79cd\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\u5bf9\u8c61\uff0c\u5e76\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5904\u7406\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u5b57\u7b26\u4e32\u683c\u5f0f\u7684\u65e5\u671f\u8f6c\u6362\u4e3a\u65f6\u95f4\u5bf9\u8c61\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>datetime<\/code>\u6a21\u5757\u4e2d\u7684<code>strptime<\/code>\u65b9\u6cd5\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\u5bf9\u8c61\u3002\u8be5\u65b9\u6cd5\u9700\u8981\u4e24\u4e2a\u53c2\u6570\uff1a\u8981\u8f6c\u6362\u7684\u5b57\u7b26\u4e32\u548c\u5b57\u7b26\u4e32\u7684\u683c\u5f0f\u3002\u4f8b\u5982\uff0c<code>datetime.datetime.strptime(&quot;2023-10-15&quot;, &quot;%Y-%m-%d&quot;)<\/code>\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32&quot;2023-10-15&quot;\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u65e5\u671f\u65f6\u95f4\u5bf9\u8c61\u3002<\/p>\n<p><strong>Python\u4e2d\u6709\u54ea\u4e9b\u5e38\u89c1\u7684\u65e5\u671f\u65f6\u95f4\u683c\u5f0f\u53ef\u4f9b\u4f7f\u7528\uff1f<\/strong><br \/>\u5728Python\u7684<code>datetime<\/code>\u6a21\u5757\u4e2d\uff0c\u5e38\u7528\u7684\u65e5\u671f\u65f6\u95f4\u683c\u5f0f\u5305\u62ec\uff1a  <\/p>\n<ul>\n<li><code>%Y<\/code> &#8211; \u56db\u4f4d\u5e74\u4efd\uff08\u59822023\uff09  <\/li>\n<li><code>%m<\/code> &#8211; \u4e24\u4f4d\u6708\u4efd\uff0801\u523012\uff09  <\/li>\n<li><code>%d<\/code> &#8211; \u4e24\u4f4d\u65e5\u671f\uff0801\u523031\uff09  <\/li>\n<li><code>%H<\/code> &#8211; \u4e24\u4f4d\u5c0f\u65f6\uff0800\u523023\uff09  <\/li>\n<li><code>%M<\/code> &#8211; \u4e24\u4f4d\u5206\u949f\uff0800\u523059\uff09  <\/li>\n<li><code>%S<\/code> &#8211; \u4e24\u4f4d\u79d2\u6570\uff0800\u523059\uff09<br \/>\u4e86\u89e3\u8fd9\u4e9b\u683c\u5f0f\u53ef\u4ee5\u5e2e\u52a9\u4f60\u6839\u636e\u4e0d\u540c\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u8fdb\u884c\u8f6c\u6362\u3002<\/li>\n<\/ul>\n<p><strong>\u5982\u679c\u5b57\u7b26\u4e32\u7684\u683c\u5f0f\u4e0d\u6b63\u786e\uff0cPython\u4f1a\u600e\u6837\u5904\u7406\uff1f<\/strong><br \/>\u5f53\u4f7f\u7528<code>strptime<\/code>\u65b9\u6cd5\u8f6c\u6362\u5b57\u7b26\u4e32\u65f6\uff0c\u5982\u679c\u5b57\u7b26\u4e32\u7684\u683c\u5f0f\u4e0e\u6307\u5b9a\u7684\u683c\u5f0f\u4e0d\u5339\u914d\uff0cPython\u5c06\u629b\u51fa<code>ValueError<\/code>\u5f02\u5e38\u3002\u8fd9\u610f\u5473\u7740\u5728\u8fdb\u884c\u5b57\u7b26\u4e32\u5230\u65f6\u95f4\u7684\u8f6c\u6362\u65f6\uff0c\u9700\u8981\u786e\u4fdd\u5b57\u7b26\u4e32\u7684\u683c\u5f0f\u5b8c\u5168\u7b26\u5408\u9884\u671f\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u5c1d\u8bd5\u5c06&quot;2023-15-10&quot;\u8f6c\u6362\u4e3a\u65e5\u671f\uff0c\u4e14\u683c\u5f0f\u4e3a&quot;%Y-%m-%d&quot;\uff0c\u5c06\u4f1a\u5bfc\u81f4\u9519\u8bef\u3002\u56e0\u6b64\uff0c\u786e\u4fdd\u8f93\u5165\u5b57\u7b26\u4e32\u4e0e\u683c\u5f0f\u76f8\u7b26\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65f6\u95f4\u7684\u65b9\u6cd5\u4e3b\u8981\u6709\u4e09\u79cd\uff1a\u4f7f\u7528datetime\u6a21\u5757\u3001\u4f7f\u7528time\u6a21\u5757\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93dat [&hellip;]","protected":false},"author":3,"featured_media":1136997,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1136991"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1136991"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1136991\/revisions"}],"predecessor-version":[{"id":1136999,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1136991\/revisions\/1136999"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1136997"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1136991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1136991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1136991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}