{"id":1082519,"date":"2025-01-08T12:49:35","date_gmt":"2025-01-08T04:49:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1082519.html"},"modified":"2025-01-08T12:49:38","modified_gmt":"2025-01-08T04:49:38","slug":"python%e5%a6%82%e4%bd%95%e5%b0%86%e6%97%b6%e9%95%bf%e6%a0%bc%e5%bc%8f%e5%8c%96-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1082519.html","title":{"rendered":"python\u5982\u4f55\u5c06\u65f6\u957f\u683c\u5f0f\u5316"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24184015\/0209fd30-0ac0-4b66-b8dc-0cf5b417b2d0.webp\" alt=\"python\u5982\u4f55\u5c06\u65f6\u957f\u683c\u5f0f\u5316\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u5c06\u65f6\u957f\u683c\u5f0f\u5316\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c<strong>\u4f7f\u7528datetime\u6a21\u5757\u3001\u4f7f\u7528time\u6a21\u5757\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93humanize<\/strong>\u3002\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5c06\u79d2\u6570\u3001\u5206\u949f\u6570\u7b49\u683c\u5f0f\u5316\u4e3a\u66f4\u6613\u8bfb\u7684\u5f62\u5f0f\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528datetime\u6a21\u5757<\/strong>\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528datetime.timedelta\u6765\u8868\u793a\u65f6\u95f4\u5dee\uff0c\u5e76\u5c06\u5176\u683c\u5f0f\u5316\u4e3a\u201c\u5929\u3001\u5c0f\u65f6\u3001\u5206\u949f\u3001\u79d2\u201d\u7684\u5f62\u5f0f\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import timedelta<\/p>\n<p>def format_duration(seconds):<\/p>\n<p>    duration = timedelta(seconds=seconds)<\/p>\n<p>    days = duration.days<\/p>\n<p>    hours, rem<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>nder = divmod(duration.seconds, 3600)<\/p>\n<p>    minutes, seconds = divmod(remainder, 60)<\/p>\n<p>    return f&quot;{days} days, {hours} hours, {minutes} minutes, {seconds} seconds&quot;<\/p>\n<p>formatted_duration = format_duration(123456)<\/p>\n<p>print(formatted_duration)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528datetime\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528datetime\u6a21\u5757\u5904\u7406\u65f6\u957f\u662f\u4e00\u4e2a\u975e\u5e38\u65b9\u4fbf\u4e14\u76f4\u89c2\u7684\u65b9\u6cd5\u3002datetime\u6a21\u5757\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u6765\u5904\u7406\u65e5\u671f\u548c\u65f6\u95f4\u3002\u901a\u8fc7\u4f7f\u7528timedelta\u5bf9\u8c61\uff0c\u6211\u4eec\u53ef\u4ee5\u65b9\u4fbf\u5730\u8868\u793a\u65f6\u95f4\u5dee\u5e76\u8fdb\u884c\u683c\u5f0f\u5316\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u521b\u5efatimedelta\u5bf9\u8c61<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2atimedelta\u5bf9\u8c61\u3002timedelta\u5bf9\u8c61\u8868\u793a\u4e24\u4e2a\u65e5\u671f\u6216\u65f6\u95f4\u4e4b\u95f4\u7684\u5dee\u5f02\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f20\u9012\u79d2\u6570\u6765\u521b\u5efatimedelta\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import timedelta<\/p>\n<p>duration = timedelta(seconds=123456)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u63d0\u53d6\u65f6\u95f4\u7ec4\u4ef6<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u63d0\u53d6timedelta\u5bf9\u8c61\u4e2d\u7684\u5404\u4e2a\u65f6\u95f4\u7ec4\u4ef6\uff0c\u5982\u5929\u6570\u3001\u5c0f\u65f6\u3001\u5206\u949f\u548c\u79d2\u6570\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528divmod\u51fd\u6570\u6765\u5b8c\u6210\u8fd9\u9879\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">days = duration.days<\/p>\n<p>hours, remainder = divmod(duration.seconds, 3600)<\/p>\n<p>minutes, seconds = divmod(remainder, 60)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u683c\u5f0f\u5316\u8f93\u51fa<\/h4>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u63d0\u53d6\u7684\u65f6\u95f4\u7ec4\u4ef6\u683c\u5f0f\u5316\u4e3a\u6240\u9700\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">formatted_duration = f&quot;{days} days, {hours} hours, {minutes} minutes, {seconds} seconds&quot;<\/p>\n<p>print(formatted_duration)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528time\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u9664\u4e86datetime\u6a21\u5757\uff0ctime\u6a21\u5757\u4e5f\u662f\u5904\u7406\u65f6\u95f4\u7684\u4e00\u4e2a\u5e38\u7528\u9009\u62e9\u3002time\u6a21\u5757\u63d0\u4f9b\u4e86\u591a\u79cd\u51fd\u6570\u6765\u5904\u7406\u65f6\u95f4\u548c\u65e5\u671f\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528time\u6a21\u5757\u6765\u683c\u5f0f\u5316\u65f6\u957f\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528gmtime\u51fd\u6570<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528time\u6a21\u5757\u4e2d\u7684gmtime\u51fd\u6570\u5c06\u79d2\u6570\u8f6c\u6362\u4e3a\u7ed3\u6784\u5316\u65f6\u95f4\u5bf9\u8c61\u3002gmtime\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u5e74\u3001\u6708\u3001\u65e5\u3001\u65f6\u3001\u5206\u3001\u79d2\u7b49\u4fe1\u606f\u7684\u7ed3\u6784\u5316\u65f6\u95f4\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<p>def format_duration(seconds):<\/p>\n<p>    struct_time = time.gmtime(seconds)<\/p>\n<p>    return time.strftime(&quot;%j days, %H hours, %M minutes, %S seconds&quot;, struct_time)<\/p>\n<p>formatted_duration = format_duration(123456)<\/p>\n<p>print(formatted_duration)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u683c\u5f0f\u5316\u8f93\u51fa<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528strftime\u51fd\u6570\u5c06\u7ed3\u6784\u5316\u65f6\u95f4\u5bf9\u8c61\u683c\u5f0f\u5316\u4e3a\u6240\u9700\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u3002strftime\u51fd\u6570\u63a5\u53d7\u4e00\u4e2a\u683c\u5f0f\u5b57\u7b26\u4e32\uff0c\u5e76\u8fd4\u56de\u683c\u5f0f\u5316\u540e\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">formatted_duration = time.strftime(&quot;%j days, %H hours, %M minutes, %S seconds&quot;, struct_time)<\/p>\n<p>print(formatted_duration)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93humanize<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u5185\u7f6e\u6a21\u5757\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93humanize\u6765\u683c\u5f0f\u5316\u65f6\u957f\u3002humanize\u5e93\u63d0\u4f9b\u4e86\u4e00\u4e9b\u65b9\u4fbf\u7684\u51fd\u6570\u6765\u5c06\u6570\u5b57\u548c\u65f6\u95f4\u8f6c\u6362\u4e3a\u66f4\u6613\u8bfb\u7684\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5humanize\u5e93<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5humanize\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install humanize<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528humanize\u5e93\u683c\u5f0f\u5316\u65f6\u957f<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528humanize\u5e93\u4e2d\u7684\u51fd\u6570\u6765\u683c\u5f0f\u5316\u65f6\u957f\u3002\u4f8b\u5982\uff0c\u4f7f\u7528naturaltime\u51fd\u6570\u53ef\u4ee5\u5c06\u79d2\u6570\u8f6c\u6362\u4e3a\u81ea\u7136\u8bed\u8a00\u63cf\u8ff0\u7684\u65f6\u95f4\u5dee\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import humanize<\/p>\n<p>from datetime import timedelta<\/p>\n<p>def format_duration(seconds):<\/p>\n<p>    duration = timedelta(seconds=seconds)<\/p>\n<p>    return humanize.naturaltime(duration)<\/p>\n<p>formatted_duration = format_duration(123456)<\/p>\n<p>print(formatted_duration)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u7efc\u5408\u5e94\u7528<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u4e0d\u540c\u7684\u683c\u5f0f\u5316\u65b9\u6cd5\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7efc\u5408\u5e94\u7528\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528\u591a\u4e2a\u65b9\u6cd5\u6765\u683c\u5f0f\u5316\u65f6\u957f\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b9a\u4e49\u683c\u5f0f\u5316\u51fd\u6570<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u901a\u7528\u7684\u683c\u5f0f\u5316\u51fd\u6570\uff0c\u6839\u636e\u4f20\u5165\u7684\u53c2\u6570\u9009\u62e9\u4e0d\u540c\u7684\u683c\u5f0f\u5316\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<p>import humanize<\/p>\n<p>from datetime import timedelta<\/p>\n<p>def format_duration(seconds, method=&quot;datetime&quot;):<\/p>\n<p>    if method == &quot;datetime&quot;:<\/p>\n<p>        duration = timedelta(seconds=seconds)<\/p>\n<p>        days = duration.days<\/p>\n<p>        hours, remainder = divmod(duration.seconds, 3600)<\/p>\n<p>        minutes, seconds = divmod(remainder, 60)<\/p>\n<p>        return f&quot;{days} days, {hours} hours, {minutes} minutes, {seconds} seconds&quot;<\/p>\n<p>    elif method == &quot;time&quot;:<\/p>\n<p>        struct_time = time.gmtime(seconds)<\/p>\n<p>        return time.strftime(&quot;%j days, %H hours, %M minutes, %S seconds&quot;, struct_time)<\/p>\n<p>    elif method == &quot;humanize&quot;:<\/p>\n<p>        duration = timedelta(seconds=seconds)<\/p>\n<p>        return humanize.naturaltime(duration)<\/p>\n<p>    else:<\/p>\n<p>        raise ValueError(&quot;Invalid method&quot;)<\/p>\n<p>formatted_duration = format_duration(123456, method=&quot;humanize&quot;)<\/p>\n<p>print(formatted_duration)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6839\u636e\u9700\u6c42\u9009\u62e9\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u4e0d\u540c\u7684\u683c\u5f0f\u5316\u65b9\u6cd5\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6211\u4eec\u9700\u8981\u66f4\u81ea\u7136\u7684\u65f6\u95f4\u63cf\u8ff0\uff0c\u53ef\u4ee5\u9009\u62e9humanize\u65b9\u6cd5\uff1b\u5982\u679c\u9700\u8981\u7cbe\u786e\u7684\u65f6\u95f4\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u9009\u62e9datetime\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">formatted_duration_datetime = format_duration(123456, method=&quot;datetime&quot;)<\/p>\n<p>formatted_duration_time = format_duration(123456, method=&quot;time&quot;)<\/p>\n<p>formatted_duration_humanize = format_duration(123456, method=&quot;humanize&quot;)<\/p>\n<p>print(formatted_duration_datetime)<\/p>\n<p>print(formatted_duration_time)<\/p>\n<p>print(formatted_duration_humanize)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86\u5728Python\u4e2d\u5c06\u65f6\u957f\u683c\u5f0f\u5316\u7684\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u4f7f\u7528datetime\u6a21\u5757\u3001time\u6a21\u5757\u4ee5\u53ca\u7b2c\u4e09\u65b9\u5e93humanize\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u7f3a\u70b9\uff0c\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528datetime\u6a21\u5757<\/strong>\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u65f6\u95f4\u7ec4\u4ef6\u63d0\u53d6\u548c\u683c\u5f0f\u5316\u529f\u80fd\uff0c\u9002\u7528\u4e8e\u9700\u8981\u7cbe\u786e\u63a7\u5236\u8f93\u51fa\u683c\u5f0f\u7684\u573a\u666f\u3002<strong>\u4f7f\u7528time\u6a21\u5757<\/strong>\u53ef\u4ee5\u7b80\u5316\u65f6\u95f4\u8f6c\u6362\u7684\u8fc7\u7a0b\uff0c\u9002\u7528\u4e8e\u9700\u8981\u5feb\u901f\u5b9e\u73b0\u65f6\u95f4\u683c\u5f0f\u5316\u7684\u573a\u666f\u3002<strong>\u4f7f\u7528humanize\u5e93<\/strong>\u5219\u63d0\u4f9b\u4e86\u66f4\u81ea\u7136\u7684\u65f6\u95f4\u63cf\u8ff0\uff0c\u9002\u7528\u4e8e\u9700\u8981\u63d0\u9ad8\u53ef\u8bfb\u6027\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u7efc\u5408\u5e94\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u6700\u9002\u5408\u7684\u683c\u5f0f\u5316\u65b9\u6cd5\uff0c\u4ece\u800c\u5b9e\u73b0\u66f4\u4e30\u5bcc\u7684\u65f6\u95f4\u683c\u5f0f\u5316\u529f\u80fd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u65f6\u957f\u8f6c\u6362\u4e3a\u5c0f\u65f6\u548c\u5206\u949f\u7684\u683c\u5f0f\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684<code>divmod()<\/code>\u51fd\u6570\u8f7b\u677e\u5c06\u65f6\u957f\uff08\u4ee5\u79d2\u4e3a\u5355\u4f4d\uff09\u8f6c\u6362\u4e3a\u5c0f\u65f6\u548c\u5206\u949f\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">total_seconds = 3661  # \u4f8b\u5982\uff0c3661\u79d2\nhours, remainder = divmod(total_seconds, 3600)\nminutes, seconds = divmod(remainder, 60)\nformatted_duration = f&quot;{hours}\u5c0f\u65f6 {minutes}\u5206\u949f {seconds}\u79d2&quot;\nprint(formatted_duration)  # \u8f93\u51fa: 1\u5c0f\u65f6 1\u5206\u949f 1\u79d2\n<\/code><\/pre>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u65f6\u957f\u4ee5\u201cHH:MM:SS\u201d\u683c\u5f0f\u8f93\u51fa\uff1f<\/strong><br \/>\u4e3a\u4e86\u5c06\u65f6\u957f\u683c\u5f0f\u5316\u4e3a\u201cHH:MM:SS\u201d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">total_seconds = 3661\nhours, remainder = divmod(total_seconds, 3600)\nminutes, seconds = divmod(remainder, 60)\nformatted_duration = f&quot;{hours:02}:{minutes:02}:{seconds:02}&quot;\nprint(formatted_duration)  # \u8f93\u51fa: 01:01:01\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u786e\u4fdd\u4e86\u6bcf\u4e2a\u90e8\u5206\u90fd\u4ee5\u4e24\u4f4d\u6570\u7684\u5f62\u5f0f\u663e\u793a\u3002<\/p>\n<p><strong>Python\u4e2d\u6709\u54ea\u4e9b\u5e93\u53ef\u4ee5\u7528\u4e8e\u65f6\u957f\u7684\u683c\u5f0f\u5316\u548c\u5904\u7406\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u591a\u4e2a\u5e93\u6765\u5904\u7406\u548c\u683c\u5f0f\u5316\u65f6\u957f\uff0c\u5176\u4e2d<code>datetime<\/code>\u5e93\u662f\u6700\u5e38\u7528\u7684\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528<code>timedelta<\/code>\u6765\u8ba1\u7b97\u65f6\u95f4\u5dee\uff0c\u5e76\u683c\u5f0f\u5316\u8f93\u51fa\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">from datetime import timedelta\n\nduration = timedelta(hours=1, minutes=1, seconds=1)\nformatted_duration = str(duration)  # \u8f93\u51fa: 1:01:01\nprint(formatted_duration)\n<\/code><\/pre>\n<p>\u6b64\u5916\uff0c<code>pandas<\/code>\u5e93\u4e5f\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u65f6\u95f4\u5904\u7406\u529f\u80fd\uff0c\u9002\u5408\u5904\u7406\u5927\u91cf\u6570\u636e\u65f6\u7684\u65f6\u95f4\u683c\u5f0f\u5316\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5c06\u65f6\u957f\u683c\u5f0f\u5316\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u4f7f\u7528datetime\u6a21\u5757\u3001\u4f7f\u7528time\u6a21\u5757\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93humani [&hellip;]","protected":false},"author":3,"featured_media":1082528,"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\/1082519"}],"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=1082519"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1082519\/revisions"}],"predecessor-version":[{"id":1082530,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1082519\/revisions\/1082530"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1082528"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1082519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1082519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1082519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}