{"id":947482,"date":"2024-12-26T23:52:03","date_gmt":"2024-12-26T15:52:03","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/947482.html"},"modified":"2024-12-26T23:52:06","modified_gmt":"2024-12-26T15:52:06","slug":"python-%e5%a6%82%e4%bd%95%e8%be%93%e5%87%ba%e6%97%b6%e9%97%b4","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/947482.html","title":{"rendered":"python \u5982\u4f55\u8f93\u51fa\u65f6\u95f4"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25083230\/d0e87a1b-6045-4c3f-9401-55a50507de57.webp\" alt=\"python \u5982\u4f55\u8f93\u51fa\u65f6\u95f4\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u8f93\u51fa\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528time\u6a21\u5757\u3001datetime\u6a21\u5757\u3001strftime\u51fd\u6570\u7b49\u3002datetime\u6a21\u5757\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u529f\u80fd\u6765\u683c\u5f0f\u5316\u548c\u64cd\u4f5c\u65e5\u671f\u65f6\u95f4\u3001time\u6a21\u5757\u5219\u7528\u4e8e\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4\u3001strftime\u51fd\u6570\u53ef\u4ee5\u5c06\u65e5\u671f\u65f6\u95f4\u5bf9\u8c61\u683c\u5f0f\u5316\u4e3a\u5b57\u7b26\u4e32\u3002<\/strong>\u5176\u4e2d\uff0cdatetime\u6a21\u5757\u662f\u6700\u5e38\u7528\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u529f\u80fd\u548c\u66f4\u9ad8\u7684\u7075\u6d3b\u6027\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u8f93\u51fa\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528TIME\u6a21\u5757<\/p>\n<\/p>\n<p><p>Python\u7684time\u6a21\u5757\u63d0\u4f9b\u4e86\u591a\u79cd\u4e0e\u65f6\u95f4\u76f8\u5173\u7684\u529f\u80fd\uff0c\u6700\u5e38\u7528\u4e8e\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233\u548c\u683c\u5f0f\u5316\u65f6\u95f4\u8f93\u51fa\u3002<\/p>\n<\/p>\n<ol>\n<li>\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u6233<\/li>\n<\/ol>\n<p><p>time\u6a21\u5757\u4e2d\u7684time()\u51fd\u6570\u53ef\u4ee5\u8fd4\u56de\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233\uff0c\u5373\u4ece1970\u5e741\u67081\u65e500:00:00 UTC\u5230\u5f53\u524d\u65f6\u95f4\u7684\u79d2\u6570\u3002\u8fd9\u5728\u8bb8\u591a\u5e94\u7528\u4e2d\u53ef\u4ee5\u7528\u4e8e\u8bb0\u5f55\u65f6\u95f4\u6216\u8ba1\u7b97\u65f6\u95f4\u5dee\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u6233<\/strong><\/h2>\n<p>timestamp = time.time()<\/p>\n<p>print(&quot;\u5f53\u524d\u65f6\u95f4\u6233\u4e3a\uff1a&quot;, timestamp)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u683c\u5f0f\u5316\u8f93\u51fa\u5f53\u524d\u65f6\u95f4<\/li>\n<\/ol>\n<p><p>time\u6a21\u5757\u63d0\u4f9b\u4e86strftime()\u51fd\u6570\uff0c\u53ef\u4ee5\u5c06\u65f6\u95f4\u683c\u5f0f\u5316\u4e3a\u53ef\u8bfb\u7684\u5b57\u7b26\u4e32\u3002strftime()\u51fd\u6570\u9700\u8981\u4e24\u4e2a\u53c2\u6570\uff1a\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u548c\u65f6\u95f4\u5143\u7ec4\u3002\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u53ef\u4ee5\u5305\u542b\u5404\u79cd\u683c\u5f0f\u7b26\u53f7\uff0c\u7528\u4e8e\u6307\u5b9a\u8f93\u51fa\u7684\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u5143\u7ec4<\/strong><\/h2>\n<p>current_time = time.localtime()<\/p>\n<h2><strong>\u683c\u5f0f\u5316\u8f93\u51fa\u5f53\u524d\u65f6\u95f4<\/strong><\/h2>\n<p>formatted_time = time.strftime(&quot;%Y-%m-%d %H:%M:%S&quot;, current_time)<\/p>\n<p>print(&quot;\u683c\u5f0f\u5316\u540e\u7684\u65f6\u95f4\u4e3a\uff1a&quot;, formatted_time)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528DATETIME\u6a21\u5757<\/p>\n<\/p>\n<p><p>datetime\u6a21\u5757\u662fPython\u4e2d\u5904\u7406\u65e5\u671f\u548c\u65f6\u95f4\u7684\u9ad8\u7ea7\u6a21\u5757\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e3a\u5f3a\u5927\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li>\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4<\/li>\n<\/ol>\n<p><p>datetime\u6a21\u5757\u7684datetime\u7c7b\u63d0\u4f9b\u4e86now()\u65b9\u6cd5\uff0c\u53ef\u4ee5\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4\u3002\u8fd4\u56de\u7684\u5bf9\u8c61\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u683c\u5f0f\u5316\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4<\/strong><\/h2>\n<p>current_datetime = datetime.now()<\/p>\n<p>print(&quot;\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4\u4e3a\uff1a&quot;, current_datetime)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528strftime()\u683c\u5f0f\u5316\u65f6\u95f4<\/li>\n<\/ol>\n<p><p>datetime\u5bf9\u8c61\u7684strftime()\u65b9\u6cd5\u4e0etime\u6a21\u5757\u7684strftime()\u51fd\u6570\u7c7b\u4f3c\uff0c\u53ef\u4ee5\u7528\u6765\u683c\u5f0f\u5316\u8f93\u51fa\u65e5\u671f\u548c\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4<\/strong><\/h2>\n<p>current_datetime = datetime.now()<\/p>\n<h2><strong>\u4f7f\u7528strftime\u683c\u5f0f\u5316\u8f93\u51fa<\/strong><\/h2>\n<p>formatted_time = current_datetime.strftime(&quot;%Y-%m-%d %H:%M:%S&quot;)<\/p>\n<p>print(&quot;\u683c\u5f0f\u5316\u540e\u7684\u65f6\u95f4\u4e3a\uff1a&quot;, formatted_time)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528STRFTIME\u51fd\u6570<\/p>\n<\/p>\n<p><p>strftime\u51fd\u6570\u5728datetime\u548ctime\u6a21\u5757\u4e2d\u90fd\u5b58\u5728\uff0c\u7528\u4e8e\u5c06\u65f6\u95f4\u5bf9\u8c61\u683c\u5f0f\u5316\u4e3a\u5b57\u7b26\u4e32\u3002\u5b83\u63a5\u53d7\u4e00\u4e2a\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\uff0c\u8be5\u5b57\u7b26\u4e32\u53ef\u4ee5\u5305\u542b\u5404\u79cd\u683c\u5f0f\u7b26\u53f7\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5e38\u7528\u7684\u683c\u5f0f\u7b26\u53f7<\/li>\n<\/ol>\n<ul>\n<li>%Y: \u56db\u4f4d\u6570\u7684\u5e74\u4efd<\/li>\n<li>%m: \u4e24\u4f4d\u6570\u7684\u6708\u4efd\uff0801\u523012\uff09<\/li>\n<li>%d: \u4e24\u4f4d\u6570\u7684\u65e5\u671f\uff0801\u523031\uff09<\/li>\n<li>%H: \u4e24\u4f4d\u6570\u7684\u5c0f\u65f6\uff0800\u523023\uff09<\/li>\n<li>%M: \u4e24\u4f4d\u6570\u7684\u5206\u949f\uff0800\u523059\uff09<\/li>\n<li>%S: \u4e24\u4f4d\u6570\u7684\u79d2\uff0800\u523059\uff09<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\u793a\u4f8b\u4ee3\u7801<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4<\/strong><\/h2>\n<p>current_datetime = datetime.now()<\/p>\n<h2><strong>\u4f7f\u7528\u4e0d\u540c\u7684\u683c\u5f0f\u7b26\u53f7\u8fdb\u884c\u683c\u5f0f\u5316<\/strong><\/h2>\n<p>formatted_date = current_datetime.strftime(&quot;%Y-%m-%d&quot;)<\/p>\n<p>formatted_time = current_datetime.strftime(&quot;%H:%M:%S&quot;)<\/p>\n<p>print(&quot;\u683c\u5f0f\u5316\u540e\u7684\u65e5\u671f\u4e3a\uff1a&quot;, formatted_date)<\/p>\n<p>print(&quot;\u683c\u5f0f\u5316\u540e\u7684\u65f6\u95f4\u4e3a\uff1a&quot;, formatted_time)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u65e5\u671f\u548c\u65f6\u95f4\u7684\u8ba1\u7b97<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u5bf9\u65e5\u671f\u548c\u65f6\u95f4\u8fdb\u884c\u52a0\u51cf\u8fd0\u7b97\uff0cdatetime\u6a21\u5757\u63d0\u4f9b\u4e86timedelta\u7c7b\u6765\u652f\u6301\u8fd9\u79cd\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ol>\n<li>\u589e\u52a0\u6216\u51cf\u5c11\u65f6\u95f4<\/li>\n<\/ol>\n<p><p>timedelta\u7c7b\u53ef\u4ee5\u7528\u6765\u589e\u52a0\u6216\u51cf\u5c11\u65f6\u95f4\uff0c\u6bd4\u5982\u589e\u52a0\u4e00\u5929\u6216\u51cf\u53bb\u4e00\u4e2a\u5c0f\u65f6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime, timedelta<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u548c\u65f6\u95f4<\/strong><\/h2>\n<p>current_datetime = datetime.now()<\/p>\n<h2><strong>\u589e\u52a0\u4e00\u5929<\/strong><\/h2>\n<p>tomorrow = current_datetime + timedelta(days=1)<\/p>\n<p>print(&quot;\u660e\u5929\u7684\u8fd9\u4e2a\u65f6\u95f4\u4e3a\uff1a&quot;, tomorrow)<\/p>\n<h2><strong>\u51cf\u53bb\u4e00\u4e2a\u5c0f\u65f6<\/strong><\/h2>\n<p>an_hour_ago = current_datetime - timedelta(hours=1)<\/p>\n<p>print(&quot;\u4e00\u5c0f\u65f6\u524d\u7684\u8fd9\u4e2a\u65f6\u95f4\u4e3a\uff1a&quot;, an_hour_ago)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u8ba1\u7b97\u65f6\u95f4\u5dee<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4e24\u4e2adatetime\u5bf9\u8c61\u76f8\u51cf\uff0c\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2atimedelta\u5bf9\u8c61\uff0c\u8868\u793a\u4e24\u4e2a\u65f6\u95f4\u70b9\u4e4b\u95f4\u7684\u5dee\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<h2><strong>\u5b9a\u4e49\u4e24\u4e2a\u65e5\u671f\u65f6\u95f4<\/strong><\/h2>\n<p>start_time = datetime(2023, 10, 1, 12, 0, 0)<\/p>\n<p>end_time = datetime(2023, 10, 2, 14, 30, 0)<\/p>\n<h2><strong>\u8ba1\u7b97\u65f6\u95f4\u5dee<\/strong><\/h2>\n<p>time_difference = end_time - start_time<\/p>\n<p>print(&quot;\u65f6\u95f4\u5dee\u4e3a\uff1a&quot;, time_difference)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u5904\u7406\u65f6\u533a<\/p>\n<\/p>\n<p><p>\u5904\u7406\u4e0d\u540c\u7684\u65f6\u533a\u662f\u65f6\u95f4\u64cd\u4f5c\u4e2d\u5e38\u89c1\u7684\u9700\u6c42\uff0cPython\u7684datetime\u6a21\u5757\u63d0\u4f9b\u4e86\u5bf9\u65f6\u533a\u7684\u652f\u6301\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528pytz\u5e93<\/li>\n<\/ol>\n<p><p>pytz\u662f\u4e00\u4e2a\u7b2c\u4e09\u65b9\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u5904\u7406\u65f6\u533a\u95ee\u9898\u3002\u5b89\u88c5pytz\u5e93\u540e\uff0c\u53ef\u4ee5\u5c06datetime\u5bf9\u8c61\u8f6c\u6362\u4e3a\u7279\u5b9a\u65f6\u533a\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pytz<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u793a\u4f8b\u4ee3\u7801<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<p>import pytz<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u65f6\u95f4<\/strong><\/h2>\n<p>current_time = datetime.now()<\/p>\n<h2><strong>\u5c06\u5f53\u524d\u65f6\u95f4\u8f6c\u6362\u4e3aUTC\u65f6\u95f4<\/strong><\/h2>\n<p>utc_time = current_time.astimezone(pytz.utc)<\/p>\n<p>print(&quot;UTC\u65f6\u95f4\u4e3a\uff1a&quot;, utc_time)<\/p>\n<h2><strong>\u5c06\u5f53\u524d\u65f6\u95f4\u8f6c\u6362\u4e3a\u7279\u5b9a\u65f6\u533a\u65f6\u95f4<\/strong><\/h2>\n<p>tz = pytz.timezone(&#39;Asia\/Shangh<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>&#39;)<\/p>\n<p>shanghai_time = current_time.astimezone(tz)<\/p>\n<p>print(&quot;\u4e0a\u6d77\u65f6\u95f4\u4e3a\uff1a&quot;, shanghai_time)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516d\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u8f93\u51fa\u65f6\u95f4\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5305\u62ectime\u6a21\u5757\u3001datetime\u6a21\u5757\u548cstrftime\u51fd\u6570\u3002<strong>datetime\u6a21\u5757\u662f\u6700\u4e3a\u5f3a\u5927\u548c\u7075\u6d3b\u7684\uff0c\u53ef\u4ee5\u7528\u4e8e\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u3001\u683c\u5f0f\u5316\u8f93\u51fa\u3001\u65f6\u95f4\u8ba1\u7b97\u548c\u65f6\u533a\u5904\u7406\u7b49\u64cd\u4f5c\u3002<\/strong>\u638c\u63e1\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6ee1\u8db3\u5927\u591a\u6570\u4e0e\u65f6\u95f4\u76f8\u5173\u7684\u7f16\u7a0b\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>datetime<\/code>\u6a21\u5757\u6765\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u5e76\u5c06\u5176\u683c\u5f0f\u5316\u4e3a\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u5e76\u8f93\u51fa\u4e3a\u201c\u5e74-\u6708-\u65e5 \u65f6:\u5206:\u79d2\u201d\u7684\u683c\u5f0f\uff1a<\/p>\n<pre><code class=\"language-python\">from datetime import datetime\n\nnow = datetime.now()\nformatted_time = now.strftime(&quot;%Y-%m-%d %H:%M:%S&quot;)\nprint(formatted_time)\n<\/code><\/pre>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u5c06\u6253\u5370\u5f53\u524d\u7684\u65e5\u671f\u548c\u65f6\u95f4\uff0c\u683c\u5f0f\u4e3a\u201c2023-10-12 14:30:45\u201d\u3002<\/p>\n<p><strong>\u5982\u4f55\u8f93\u51fa\u7279\u5b9a\u65f6\u95f4\u7684\u683c\u5f0f\u5316\u7ed3\u679c\uff1f<\/strong><br \/>\u5982\u679c\u9700\u8981\u8f93\u51fa\u7279\u5b9a\u65f6\u95f4\u7684\u683c\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528<code>datetime<\/code>\u6a21\u5757\u521b\u5efa\u4e00\u4e2a\u65f6\u95f4\u5bf9\u8c61\uff0c\u5e76\u4f7f\u7528<code>strftime<\/code>\u65b9\u6cd5\u8fdb\u884c\u683c\u5f0f\u5316\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">from datetime import datetime\n\nspecific_time = datetime(2023, 10, 12, 14, 30)\nformatted_time = specific_time.strftime(&quot;%d\/%m\/%Y %I:%M %p&quot;)\nprint(formatted_time)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u8f93\u51fa\u201c12\/10\/2023 02:30 PM\u201d\u7684\u683c\u5f0f\uff0c\u9002\u5408\u5728\u9700\u8981\u7279\u5b9a\u683c\u5f0f\u7684\u573a\u5408\u4f7f\u7528\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u8f93\u51fa\u65f6\u95f4\u7684\u65f6\u95f4\u6233\uff1f<\/strong><br \/>\u8981\u8f93\u51fa\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233\uff0c\u53ef\u4ee5\u4f7f\u7528<code>time<\/code>\u6a21\u5757\u4e2d\u7684<code>time()<\/code>\u51fd\u6570\u3002\u65f6\u95f4\u6233\u8868\u793a\u81ea1970\u5e741\u67081\u65e5\u4ee5\u6765\u7684\u79d2\u6570\u3002\u4ee5\u4e0b\u662f\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u6233\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">import time\n\ntimestamp = time.time()\nprint(&quot;\u5f53\u524d\u65f6\u95f4\u6233\uff1a&quot;, timestamp)\n<\/code><\/pre>\n<p>\u6267\u884c\u8fd9\u6bb5\u4ee3\u7801\u5c06\u8fd4\u56de\u4e00\u4e2a\u6d6e\u70b9\u6570\uff0c\u8868\u793a\u5f53\u524d\u7684\u65f6\u95f4\u6233\u3002\u8fd9\u5bf9\u4e8e\u9700\u8981\u8fdb\u884c\u65f6\u95f4\u8ba1\u7b97\u6216\u5b58\u50a8\u65f6\u95f4\u4fe1\u606f\u7684\u573a\u666f\u975e\u5e38\u6709\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u8f93\u51fa\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528time\u6a21\u5757\u3001datetime\u6a21\u5757\u3001strftime\u51fd\u6570\u7b49\u3002da [&hellip;]","protected":false},"author":3,"featured_media":947491,"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\/947482"}],"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=947482"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/947482\/revisions"}],"predecessor-version":[{"id":947496,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/947482\/revisions\/947496"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/947491"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=947482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=947482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=947482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}