{"id":53651,"date":"2021-01-18T16:36:21","date_gmt":"2021-01-18T08:36:21","guid":{"rendered":"http:\/\/www.zhushiyao.com\/?p=53651"},"modified":"2021-01-18T16:37:51","modified_gmt":"2021-01-18T08:37:51","slug":"396c46da76","status":"publish","type":"post","link":"http:\/\/www.zhushiyao.com\/?p=53651","title":{"rendered":"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3"},"content":{"rendered":"<div class=\"bpp-post-content\">\n<section style=\"letter-spacing: 0.544px; white-space: normal; font-family: PingFangSC-Light; font-size: 15px; background-color: #ffffff; text-align: center; margin-bottom: 5px;\"><span style=\"text-align: center; font-size: 12px;\"><span style=\"color: #3e3e3e; word-spacing: 1px; letter-spacing: 1px; background-color: #ffffff;\">\u00a0<\/span><\/span><\/section>\n<p style=\"font-family: -apple-system, system-ui, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 12px;\"><span style=\"font-size: 12px; color: #3e3e3e; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;\">\u4f5c\u8005\uff1aPeter<\/span><br style=\"color: #3e3e3e; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; font-size: 13px;\" \/><span style=\"font-size: 12px; color: #3e3e3e; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;\">\u6765\u6e90\uff1aPython\u7f16\u7a0b\u65f6\u5149<\/span><\/span><\/p>\n<section style=\"font-size: 16px; color: #3e3e3e; line-height: 1.6; letter-spacing: 0px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;\">\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5728\u751f\u6d3b\u548c\u5de5\u4f5c\u4e2d\uff0c\u6211\u4eec\u6bcf\u4e2a\u4eba\u6bcf\u5929\u90fd\u5728\u548c<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u65f6\u95f4<\/strong>\u6253\u4ea4\u9053\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u65e9\u4e0a\u4ec0\u4e48\u65f6\u5019\u8d77\u5e8a\uff1f<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u5730\u94c1\u51e0\u5206\u949f\u6765\u4e00\u8d9f\uff1f<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u4e2d\u5348\u4ec0\u4e48\u65f6\u5019\u5f00\u59cb\u5348\u4f11\uff1f<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u660e\u5929\u662f\u661f\u671f\u51e0\uff1f<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u8ddd\u79bb\u4e0a\u6b21\u4e70\u8863\u670d\u5df2\u7ecf2\u4e2a\u6708\u5462\uff1f<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u9886\u5bfc\u8ba9\u6211\u7ed9\u4ee3\u7801\u52a0\u4e0a\u4e00\u4e2a\u5b9a\u65f6\u4efb\u52a1\u7684\u529f\u80fd\uff0c\u600e\u4e48\u529e\uff1f<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u4e0d\u540c\u7684\u60c5\u51b5\u4f1a\u9047\u5230\u4e0d\u540c\u7684\u65f6\u95f4\u95ee\u9898\uff1a<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u5177\u4f53\u65f6\u95f4\u70b9\u3001\u65f6\u95f4\u95f4\u9694\u3001\u661f\u671f<\/strong>\u7b49\uff0c\u65e0\u65f6\u4e0d\u523b\u6211\u4eec\u5728\u548c\u65f6\u95f4\u78b0\u649e\u3002\u672c\u6587\u5c06\u5229\u7528Python\u5bf9\u65f6\u95f4\u76f8\u5173\u7684\u7c7b\uff0c\u53ca\u5176\u65b9\u6cd5\u4e0e\u5c5e\u6027\u7b49\u8fdb\u884c\u8be6\u7ec6\u7684\u8bb2\u89e3<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/8-1610958981.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h2 style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.2em; border-bottom: 1.5px solid #ec4444;\"><span style=\"font-size: inherit; line-height: inherit; display: inline-block; font-weight: normal; background: #ec4444; color: #ffffff; padding-top: 3px; padding-right: 10px; padding-left: 10px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">1. \u65f6\u95f4\u6233<\/span><\/h2>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">1.1\u65f6\u95f4\u6233\u7b80\u4ecb<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5728\u6b63\u5f0f\u8bb2\u89e3\u65f6\u95f4\u7684\u76f8\u5173\u51fd\u6570\u4e4b\u524d\uff0c\u6211\u4eec\u5fc5\u987b\u5148\u4e00\u4e2a\u6982\u5ff5\uff1a<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u65f6\u95f4\u6233<\/strong>\u3002\u672c\u6587\u4e2d\u7279\u6307<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">unix<\/code>\u65f6\u95f4\u6233\u3002<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u65f6\u95f4\u6233Timestamp\u662f\u6307\u5728\u4e00\u8fde\u4e32\u7684\u6570\u636e\u4e2d\u52a0\u5165\u8fa8\u8bc6\u6587\u5b57\uff0c\u5982\u65f6\u95f4\u6216\u8005\u65e5\u671f\u7b49\uff0c\u7528\u4ee5\u4fdd\u969c\u672c\u5730\u6570\u636e\u66f4\u65b0\u987a\u5e8f\u548c\u8fdc\u7a0b\u7684\u4e00\u81f4\u3002<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">unix<\/code>\u65f6\u95f4\u6233\u662f\u4ece1970\u5e741\u67081\u65e5\uff08UTC\/GMT\u7684\u5348\u591c\uff09\u5f00\u59cb\u6240\u7ecf\u8fc7\u7684\u79d2\u6570\uff0c\u4e0d\u8003\u8651\u95f0\u79d2\u30021970-01-01\u5c31\u662f\u7ecf\u5e38\u6211\u4eec\u5728MySQL\u4e2d\u65f6\u95f4\u4e3a\u7a7a\u7684\u65f6\u5019\uff0c\u8f6c\u5316\u7a7a\u7684\u65f6\u95f4\u6233\u4e4b\u540e\u5f97\u5230\u7684\u65f6\u95f4\u3002\u4e00\u4e2a\u5c0f\u65f6\u8868\u793a\u4e3aUNIX\u65f6\u95f4\u6233\u683c\u5f0f\u4e3a\uff1a3600\u79d2\uff1b\u4e00\u5929\u8868\u793a\u4e3aUNIX\u65f6\u95f4\u6233\u4e3a86400\u79d2\uff0c\u95f0\u79d2\u4e0d\u8ba1\u7b97\u3002\u5177\u4f53\u7684\u5bf9\u7167\u8868\u5982\u4e0b\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; box-sizing: border-box; border: 0px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/3-1610958981.png\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">1.2\u65f6\u95f4\u6233\u8f6c\u5316\u7f51\u7ad9<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u4e0b\u9762\u4ecb\u7ecd\u51e0\u4e2a<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u65f6\u95f4\u6233\u548c\u5177\u4f53\u65f6\u95f4<\/strong>\u4e4b\u95f4\u76f8\u4e92\u8f6c\u5316\u7684\u7f51\u7ad9\uff1a<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">1\u3001\u7ad9\u957f\u5de5\u5177\uff1ahttps:\/\/tool.chinaz.com\/tools\/unixtime.aspx<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">2\u3001\u5728\u7ebf\u5de5\u5177\uff1ahttps:\/\/tool.lu\/timestamp\/<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">3\u3001Json\u5728\u7ebf\u89e3\u6790\uff1ahttps:\/\/www.sojson.com\/unixtime.html<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">4\u3001Unix\u65f6\u95f4\u6233\u5728\u7ebf\u8f6c\u6362\uff08\u83dc\u9e1f\u5de5\u5177\uff09\uff1ahttps:\/\/c.runoob.com\/front-end\/852<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">5\u3001\u5317\u4eac\u65f6\u95f4\uff08\u65f6\u95f4\u4e0e\u65f6\u95f4\u6233\u4e92\u6362\u5de5\u5177\uff09\uff1ahttp:\/\/www.beijing-time.org\/shijianchuo\/<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u4ecb\u7ecd\u5b8c\u65f6\u95f4\u6233\u7684\u57fa\u672c\u77e5\u8bc6\uff0c\u4e0b\u9762\u91cd\u70b9\u8bb2\u89e33\u4e2a\u4e0e\u65f6\u95f4\u548c\u65e5\u671f\u76f8\u5173\u7684Python\u5e93\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">calendar<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">time<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">datetime<\/span><\/p>\n<\/li>\n<\/ul>\n<h2 style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.2em; border-bottom: 1.5px solid #ec4444;\"><span style=\"font-size: inherit; line-height: inherit; display: inline-block; font-weight: normal; background: #ec4444; color: #ffffff; padding-top: 3px; padding-right: 10px; padding-left: 10px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">2.calendar<\/span><\/h2>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">calendar<\/code>\u7684\u4e2d\u6587\u610f\u601d\u662f&#8221;\u65e5\u5386&#8221;\uff0c\u6240\u4ee5\u5b83\u5176\u5b9e\u9002\u5408\u8fdb\u884c\u65e5\u671f\uff0c\u5c24\u5176\u662f\u4ee5\u65e5\u5386\u7684\u5f62\u5f0f\u5c55\u793a\u3002<\/p>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.1\u6a21\u5757\u5185\u5bb9<\/span><\/h3>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/5-1610958981.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u4e0b\u9762\u4e3e\u4f8b\u8bf4\u660e\uff1a<\/p>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.2calendar<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u6211\u4eec\u663e\u793a\u5373\u5c06\u8fc7\u53bb2020\u5e74\u7684\u65e5\u5386\uff0c\u4f7f\u7528\u9ed8\u8ba4\u7684\u53c2\u6570\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0calendar<br \/>year\u00a0=\u00a0calendar.calendar(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>)<br \/>print(year)<br \/><\/code><\/pre>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/8-1610958981-1.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u6539\u53d8\u53c2\u6570\u518d\u6765\u663e\u793a\u4e00\u6b21\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\">year\u00a0=\u00a0calendar.calendar(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,w=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">3<\/span>,l=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">1<\/span>,c=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">8<\/span>)<br \/>print(year)<br \/><\/code><\/pre>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/4-1610958981.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u6211\u4eec\u53d1\u73b0\u6574\u4e2a\u65e5\u5386\u53d8\u5bbd\u4e86\uff0c\u800c\u4e14\u661f\u671f\u7684\u82f1\u6587\u4e5f\u662f3\u4e2a\u5b57\u6bcd\u6765\u663e\u793a\u7684\uff0c\u89e3\u91ca\u4e00\u4e0b3\u4e2a\u53c2\u6570\u7684\u542b\u4e49\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">c\uff1a\u6bcf\u6708\u95f4\u9694\u8ddd\u79bb<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">w\uff1a\u6bcf\u65e5\u5bbd\u5ea6\u95f4\u9694<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">l\uff1a\u6bcf\u661f\u671f\u884c\u6570<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5176\u4e2d\u6bcf\u884c\u957f\u5ea6\u4e3a\uff1a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">21*w+18+2*c<\/code>\uff0c3\u4e2a\u6708\u4e00\u884c<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u6700\u540e\uff0c\u770b\u770b\u5373\u5c06\u5230\u6765\u76842021\u5e74\u65e5\u5386\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/7-1610958981.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.3isleap(year)<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u8be5\u51fd\u6570\u7684\u4f5c\u7528\u662f<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u5224\u65ad\u67d0\u4e2a\u5e74\u4efd\u5230\u5e95\u662f\u4e0d\u662f\u95f0\u5e74<\/strong>\u3002\u5982\u679c\u662f\u5219\u8fd4\u56deTrue\uff0c\u5426\u5219\u8fd4\u56de\u7684\u662fFalse\u3002<\/p>\n<blockquote style=\"line-height: inherit; border-left-color: #ef7060; margin-top: 20px; margin-bottom: 20px; font-size: 0.9em; overflow: auto; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"color: inherit; line-height: inherit; font-size: 15px;\">\u666e\u901a\u5e74\u4efd\u80fd\u591f\u88ab4\u6574\u9664\uff0c\u4f46\u662f\u4e0d\u80fd\u88ab100\u6574\u9664\uff0c\u79f0\u4e4b\u4e3a\u666e\u901a\u95f0\u5e74<\/p>\n<p style=\"color: inherit; line-height: inherit; font-size: 15px;\">\u5e74\u4efd\u662f\u6574\u767e\u6570\u7684\uff0c\u5fc5\u987b\u80fd\u591f\u88ab400\u6574\u9664\uff0c\u79f0\u4e4b\u4e3a\u4e16\u7eaa\u95f0\u5e74<\/p>\n<\/blockquote>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/1-1610958981.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.4leapdays(y1,y2)<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u5224\u65ad\u4e24\u4e2a\u5e74\u4efd\u4e4b\u95f4\u6709\u591a\u5c11\u4e2a\u95f0\u5e74<\/strong>\uff0c\u5305\u542by1\uff0c\u4f46\u662f\u4e0d\u5305\u542by2\uff0c\u7c7b\u4f3cPython\u5207\u7247\u4e2d\u7684<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u5305\u542b\u5934\u90e8\u4e0d\u5305\u542b\u5c3e\u90e8<\/strong><\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/8-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.5month(year,month,w=2,l=1)<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u8be5\u51fd\u6570\u8fd4\u56de\u7684\u662f<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">year<\/code>\u5e74\u7684<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">month<\/code>\u6708\u7684\u65e5\u5386\uff0c\u53ea\u6709\u4e24\u884c\u6807\u9898\uff0c\u4e00\u5468\u4e00\u884c\u3002\u6bcf\u65e5\u95f4\u9694\u5bbd\u5ea6\u4e3aw\u4e2a\u5b57\u7b26\uff0c\u6bcf\u884c\u7684\u957f\u5ea6\u4e3a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">7*w + 6<\/code>\uff0c\u5176\u4e2dl\u662f\u6bcf\u661f\u671f\u7684\u884c\u6570<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u9996\u5148\u770b\u770b\u9ed8\u8ba4\u6548\u679c\uff1b<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/6-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u63a5\u4e0b\u6765\u6211\u4eec\u6539\u53d8w\u548cl\u4e24\u4e2a\u53c2\u6570\uff1a<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">1\u3001\u6539\u53d8<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">w<\/code>\uff0c\u6211\u4eec\u53d1\u73b0\u661f\u671f\u7684\u8868\u793a\u53d8\u6210\u4e863\u4e2a\u5b57\u6bcd\uff1b\u540c\u65f6\u6bcf\u5929\u4e4b\u95f4\u7684\u95f4\u9694\u53d8\u5bbd\u4e86\uff08\u5de6\u53f3\u95f4\u9694\uff09<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/6-1610958982-1.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">2\u3001\u6539\u53d8\u53c2\u6570<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">l<\/code>\uff0c\u6211\u4eec\u53d1\u73b0\u6bcf\u4e2a\u661f\u671f\u4e4b\u524d\u7684\u95f4\u9694\uff08\u4e0a\u4e0b\uff09\u53d8\u5bbd\u4e86<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/5-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.6monthcalendar(year,month)<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u901a\u8fc7\u5217\u8868\u7684\u5f62\u5f0f\u8fd4\u56deyear\u5e74month\u6708\u7684\u65e5\u5386\uff0c\u5217\u8868\u4e2d\u8fd8\u662f\u5217\u8868\u5f62\u5f0f\u3002\u6bcf\u4e2a\u5b50\u5217\u8868\u662f\u4e00\u4e2a\u661f\u671f\u3002<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u5982\u679c\u6ca1\u6709\u672c\u6708\u7684\u65e5\u671f\u5219\u75280\u8868\u793a<\/strong>\u3002\u6bcf\u4e2a\u5b50\u5217\u8868\u90fd\u662f\u4ece\u661f\u671f1\u5f00\u59cb\u7684\uff0c\u7279\u70b9\u6982\u62ec\u5982\u4e0b\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u6bcf\u4e2a\u5b50\u5217\u8868\u4ee3\u8868\u7684\u662f\u4e00\u4e2a\u661f\u671f<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u4ece\u661f\u671f\u4e00\u5230\u661f\u671f\u65e5\uff0c\u6ca1\u6709\u51fa\u73b0\u5728\u672c\u6708\u7684\u65e5\u671f\u75280\u4ee3\u66ff<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u6211\u4eec\u8fd8\u662f\u4ee52020\u5e7412\u6708\u4efd\u4e3a\u4f8b\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/10-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u548c\u4e0a\u9762\u7684\u65e5\u5386\u8fdb\u884c\u5bf9\u6bd4\uff0c\u6211\u4eec\u53d1\u73b0\uff1a<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u51fa\u73b00\u7684\u4f4d\u7f6e\u7684\u786e\u662f\u6ca1\u6709\u51fa\u73b0\u572812\u6708\u4efd\u4e2d<\/strong><\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u6211\u4eec\u518d\u770b\u770b2020\u5e743\u6708\u4efd\u7684\u65e5\u5386\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/3-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.7monthrange(year,month)<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u8be5\u51fd\u6570\u8fd4\u56de\u7684\u7ed3\u679c\u662f\u4e00\u4e2a\u5143\u7ec4\uff0c\u5143\u7ec4\u4e2d\u6709\u4e24\u4e2a\u6570\u503c<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">(a,b)<\/code><\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u6570\u503ca\u4ee3\u8868\u7684\u662f\u8be5\u6708\u4ece\u661f\u671f\u51e0\u5f00\u59cb\uff1b\u89c4\u5b9a6\u4ee3\u8868\u661f\u671f\u5929\uff0c\u53d6\u503c\u4e3a0-6<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u6570\u503cb\u4ee3\u8868\u8be5\u6708\u603b\u5171\u6709\u591a\u5c11\u5929<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u901a\u8fc7\u4e00\u4e2a\u4f8b\u5b50\u6765\u8bb2\u89e3\uff0c\u8fd8\u662f\u4ee52020\u5e7412\u6708\u4efd\u4e3a\u4f8b\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/6-1610958982-2.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u7ed3\u679c\u4e2d\u76841\u8868\u793a12\u6708\u4efd\u4ece\u661f\u671f2\u5f00\u59cb\uff080-6\uff0c6\u4ee3\u8868\u661f\u671f\u65e5\uff09\uff0c\u8be5\u6708\u603b\u517131\u5929<\/p>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">2.8weekday(y,m,d)<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">weekday\u65b9\u6cd5\u662f\u8f93\u5165\u5e74\u6708\u65e5\uff0c\u6211\u4eec\u4fbf\u53ef\u77e5\u9053\u8fd9\u5929\u662f\u661f\u671f\u51e0\uff1b<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u8fd4\u56de\u503c\u662f0-6\uff0c0\u4ee3\u8868\u661f\u671f1\uff0c6\u4ee3\u8868\u661f\u671f\u5929<\/strong><\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u901a\u8fc7\u4e00\u4e2a\u4f8b\u5b50\u6765\u8bb2\u89e3\uff0c\u4ee512\u670812\u53f7\u4e3a\u4f8b\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/3-1610958982-1.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u53cc12\u662f\u661f\u671f\u516d\uff0c\u8fd4\u56de\u7684\u7ed3\u679c\u662f5\uff0c5\u4ee3\u8868\u7684\u5c31\u662f\u661f\u671f\u516d\uff0c\u521a\u597d\u543b\u5408\u3002<\/p>\n<h2 style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.2em; border-bottom: 1.5px solid #ec4444;\"><span style=\"font-size: inherit; line-height: inherit; display: inline-block; font-weight: normal; background: #ec4444; color: #ffffff; padding-top: 3px; padding-right: 10px; padding-left: 10px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">3.time<\/span><\/h2>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">time\u6a21\u5757\u662f\u6d89\u53ca\u5230\u65f6\u95f4\u529f\u80fd\u4e2d\u6700\u5e38\u7528\u7684\u4e00\u4e2a\u6a21\u5757<\/strong>\uff0c\u5728Python\u7684\u76f8\u5173\u65f6\u95f4\u9700\u6c42\u4e2d\u7ecf\u5e38\u4f1a\u7528\u5230\uff0c\u4e0b\u9762\u5177\u4f53\u8bb2\u89e3\u8be5\u6a21\u5757\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.1\u6a21\u5757\u5185\u5bb9<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5148\u770b\u6a21\u5757\u7684\u6574\u4f53\u4f7f\u7528<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/6-1610958982-3.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.2time<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.time()<\/code>\u662f\u83b7\u53d6\u5f53\u524d\u7684\u65f6\u95f4\uff0c\u66f4\u52a0\u4e25\u683c\u5730\u8bf4\uff0c\u662f\u83b7\u53d6<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233<\/strong>\u3002<\/p>\n<blockquote style=\"line-height: inherit; border-left-color: #ef7060; margin-top: 20px; margin-bottom: 20px; font-size: 0.9em; overflow: auto; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"color: inherit; line-height: inherit; font-size: 15px;\">\u518d\u6b21\u7406\u89e3\u65f6\u95f4\u6233\uff1a\u5b83\u662f\u4ee51970\u5e741\u67081\u65e50\u65f60\u4efd0\u79d2\u4e3a\u8ba1\u65f6\u8d77\u70b9\uff0c\u8ba1\u7b97\u5230\u5f53\u524d\u7684\u65f6\u95f4\u957f\u5ea6\uff08\u4e0d\u8003\u8651\u95f0\u79d2\uff09<\/p>\n<\/blockquote>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/4-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.3localtime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.localtime<\/code>\u662f<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u6253\u5370\u5f53\u524d\u7684\u65f6\u95f4<\/strong>\uff0c\u5f97\u5230\u7684\u7ed3\u679c\u662f<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u65f6\u95f4\u5143\u7ec4<\/strong>\uff0c\u5177\u4f53\u542b\u4e49\uff1a<\/p>\n<blockquote style=\"line-height: inherit; border-left-color: #ef7060; margin-top: 20px; margin-bottom: 20px; font-size: 0.9em; overflow: auto; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"color: inherit; line-height: inherit; font-size: 15px;\">\u7b14\u8bb0\uff1a\u7ed3\u679c\u662f\u65f6\u95f4\u5143\u7ec4<\/p>\n<\/blockquote>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; box-sizing: border-box; border: 0px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/2-1610958982.png\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.localtime<\/code>\u7684\u53c2\u6570\u9ed8\u8ba4\u662f<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.time()<\/code>\u7684\u65f6\u95f4\u6233\uff0c\u53ef\u4ee5\u81ea\u5df1\u8f93\u5165\u67d0\u4e2a\u65f6\u95f4\u6233\u6765\u83b7\u53d6\u5176\u5bf9\u5e94\u7684\u65f6\u95f4<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u9ed8\u8ba4\u5f53\u524d\u65f6\u95f4\u6233<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u6307\u5b9a\u67d0\u4e2a\u65f6\u95f4\u6233<\/span><\/p>\n<\/li>\n<\/ul>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/7-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.4gmtime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">localtime()<\/code>\u5f97\u5230\u7684\u662f<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u672c\u5730\u65f6\u95f4<\/strong>\uff0c\u5982\u679c\u9700\u8981\u56fd\u9645\u5316\uff0c\u4f7f\u7528<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">gmtime()<\/code>\uff0c\u6700\u597d\u662f\u4f7f\u7528\u683c\u6797\u5a01\u6cbb\u65f6\u95f4\u3002<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u683c\u6797\u5a01\u6cbb\u6807\u51c6\u65f6\u95f4\uff1a\u4f4d\u4e8e\u82f1\u56fd\u4f26\u6566\u90ca\u533a\u7684\u7687\u5bb6\u683c\u6797\u5a01\u6cbb\u5929\u6587\u53f0\u7684\u6807\u51c6\u65f6\u95f4\uff0c\u672c\u521d\u5b50\u5348\u7ebf\u7ecf\u8fc7\u90a3\u91cc\u3002<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/3-1610958982-2.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.5asctime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.asctime<\/code>\u7684\u53c2\u6570\u4e3a\u7a7a\u65f6\uff0c\u9ed8\u8ba4\u662f<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u4ee5time.localtime\u7684\u503c\u4e3a\u53c2\u6570<\/strong>\uff0c\u5f97\u5230\u5f53\u524d\u7684\u65e5\u671f\u3001\u65f6\u95f4\u3001\u661f\u671f\uff1b\u53e6\u5916\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u81ea\u5df1\u8bbe\u7f6e\u53c2\u6570\uff0c<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u53c2\u6570\u662f\u65f6\u95f4\u5143\u7ec4<\/strong><\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u4f7f\u7528\u5f53\u524d\u65f6\u95f4\u7684\u9ed8\u8ba4\u65f6\u95f4\u5143\u7ec4localtime<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u81ea\u5df1\u6307\u5b9a\u4e00\u4e2a\u65f6\u95f4\u5143\u7ec4<\/span><\/p>\n<\/li>\n<\/ul>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/4-1610958982-1.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u5177\u4f53\u65f6\u95f4\u548c\u65e5\u671f\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/4-1610958982-2.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.6ctime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">ctime<\/code>\u7684\u53c2\u6570\u9ed8\u8ba4\u662f\u65f6\u95f4\u6233\uff1b\u5982\u679c\u6ca1\u6709\uff0c\u4e5f\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u65f6\u95f4\u6233<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/2-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.7mktime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">mktime()<\/code>\u4e5f\u662f\u4ee5\u65f6\u95f4\u5143\u7ec4\u4e3a\u53c2\u6570\u7684\uff0c\u5b83\u8fd4\u56de\u7684\u662f\u65f6\u95f4\u6233\uff0c<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u76f8\u5f53\u4e8e\u662f<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">localtime<\/code>\u7684\u9006\u5411\u8fc7\u7a0b<\/strong>\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/9-1610958982.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.8strftime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">strftime()<\/code>\u662f\u6309\u7167\u6211\u4eec\u6307\u5b9a\u7684\u683c\u5f0f<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u5c06\u65f6\u95f4\u5143\u7ec4\u8f6c\u5316\u4e3a\u5b57\u7b26\u4e32<\/strong>\uff1b\u5982\u679c\u4e0d\u6307\u5b9a\u65f6\u95f4\u5143\u7ec4\uff0c\u9ed8\u8ba4\u662f\u5f53\u524d\u65f6\u95f4<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">localtime()<\/code>\u3002\u5e38\u7528\u5230\u7684\u65f6\u95f4\u683c\u5f0f\u89c1\u4e0b\u8868\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; box-sizing: border-box; border: 0px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/4-1610958982.png\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u6211\u4eec\u4e3e\u4f8b\u8bf4\u660e\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u5b57\u7b26\u4e32\u4e2d\u7684\u5206\u9694\u7b26\u6211\u4eec\u53ef\u4ee5\u4efb\u610f\u6307\u5b9a<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u53ef\u4ee5\u540c\u65f6\u663e\u793a\u5e74\u6708\u65e5\u65f6\u5206\u79d2\u7b49<\/span><\/p>\n<\/li>\n<\/ul>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/7-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">3.9strptime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">strptime()<\/code>\u662f\u5c06\u5b57\u7b26\u4e32\u8f6c\u5316\u4e3a\u65f6\u95f4\u5143\u7ec4\uff0c\u6211\u4eec\u9700\u8981\u7279\u522b\u6ce8\u610f\u7684\u662f\uff0c\u5b83\u6709\u4e24\u4e2a\u53c2\u6570\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u5f85\u8f6c\u5316\u7684\u5b57\u7b26\u4e32<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u65f6\u95f4\u5b57\u7b26\u4e32\u5bf9\u5e94\u7684\u683c\u5f0f\uff0c\u683c\u5f0f\u5c31\u662f\u4e0a\u9762\ud83d\udc46\u8868\u4e2d\u63d0\u5230\u7684<\/span><\/p>\n<\/li>\n<\/ul>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/9-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h2 style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.2em; border-bottom: 1.5px solid #ec4444;\"><span style=\"font-size: inherit; line-height: inherit; display: inline-block; font-weight: normal; background: #ec4444; color: #ffffff; padding-top: 3px; padding-right: 10px; padding-left: 10px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">4.datetime<\/span><\/h2>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u867d\u7136<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time<\/code>\u6a21\u5757\u5df2\u7ecf\u80fd\u591f\u89e3\u51b3\u5f88\u591a\u7684\u95ee\u9898\uff0c\u4f46\u662f\u5b9e\u9645\u5de5\u4f5c\u548c\u4e1a\u52a1\u9700\u6c42\u4e2d\u9700\u8981\u66f4\u591a\u7684\u5de5\u5177\uff0c\u8ba9\u6211\u4eec\u4f7f\u7528\u8d77\u6765\u66f4\u65b9\u4fbf\u548c\u5feb\u6377\uff0c<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">datetime<\/code>\u4fbf\u662f\u5176\u4e2d\u4e00\u4e2a\u5f88\u597d\u7528\u7684\u6a21\u5757\u3002<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">datetime<\/code>\u6a21\u5757\u4e2d\u51e0\u4e2a\u5e38\u7528\u7684\u7c7b\u5982\u4e0b\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">date<\/code>\uff1a\u65e5\u671f\u7c7b\uff0c\u5e38\u7528\u5c5e\u6027\uff1a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">year\/month\/day<\/code><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time<\/code>\uff1a\u65f6\u95f4\u7c7b\uff0c\u5e38\u7528\u5c5e\u6027\uff1a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">hour\/minute\/second\/microsecond<\/code><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">datetime<\/code>\uff1a\u65e5\u671f\u65f6\u95f4\u7c7b<\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">timedelta<\/code>\uff1a\u65f6\u95f4\u95f4\u9694\uff0c\u5373\u4e24\u4e2a\u65f6\u95f4\u70b9\u4e4b\u95f4\u7684\u65f6\u95f4\u957f\u5ea6<\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">tzinfo<\/code>\uff1a\u65f6\u533a\u7c7b<\/p>\n<\/li>\n<\/ul>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">4.1\u6a21\u5757\u5185\u5bb9<\/span><\/h3>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/9-1610958983-1.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<section style=\"font-size: 16px; color: #3e3e3e; line-height: 1.6; letter-spacing: 0px; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;\">\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; box-sizing: border-box; border: 0px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/9-1610958983.png\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<\/section>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\">\u00a0<\/h3>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">4.2date<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u9996\u5148\u6211\u4eec\u5f15\u5165<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">date<\/code>\u7c7b\uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u65e5\u671f\u5bf9\u8c61\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/1-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">1\u3001\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u64cd\u4f5c\u8fd9\u4e2a\u65e5\u671f\u5bf9\u8c61\u7684\u5404\u79cd\u5c5e\u6027\uff1a\u540e\u9762\u52a0\u4e0a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">()<\/code><\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\">print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u5f53\u524d\u65e5\u671f\uff1a\"<\/span>,today)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u5f53\u524d\u65e5\u671f<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u5f53\u524d\u65e5\u671f(\u5b57\u7b26\u4e32)\uff1a\"<\/span>,today.ctime())\u00a0\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8fd4\u56de\u65e5\u671f\u7684\u5b57\u7b26\u4e32<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u65f6\u95f4\u5143\u7ec4\u4fe1\u606f\uff1a\"<\/span>,today.timetuple())\u00a0\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u5f53\u524d\u65e5\u671f\u7684\u65f6\u95f4\u5143\u7ec4\u4fe1\u606f<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u5e74\uff1a\"<\/span>,today.year)\u00a0\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8fd4\u56detoday\u5bf9\u8c61\u7684\u5e74\u4efd<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u6708\uff1a\"<\/span>,today.month)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8fd4\u56detoday\u5bf9\u8c61\u7684\u6708\u4efd<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u65e5\uff1a\"<\/span>,today.day)\u00a0\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8fd4\u56detoday\u5bf9\u8c61\u7684\u65e5<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u661f\u671f\uff1a\"<\/span>,today.weekday())\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a00\u4ee3\u8868\u661f\u671f\u4e00\uff0c\u7c7b\u63a8<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u516c\u5386\u5e8f\u6570\uff1a\"<\/span>,today.toordinal())\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8fd4\u56de\u516c\u5386\u65e5\u671f\u7684\u5e8f\u6570<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u5e74\/\u5468\u6570\/\u661f\u671f\uff1a\"<\/span>,today.isocalendar())\u00a0\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8fd4\u56de\u4e00\u4e2a\u5143\u7ec4\uff1a\u4e00\u5e74\u4e2d\u7684\u7b2c\u51e0\u5468\uff0c\u661f\u671f\u51e0<\/span><br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c\u663e\u793a<\/span><br \/>\u5f53\u524d\u65e5\u671f\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span><br \/>\u5f53\u524d\u65e5\u671f(\u5b57\u7b26\u4e32)\uff1aFri Dec <span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">25<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><br \/>\u65f6\u95f4\u5143\u7ec4\u4fe1\u606f\uff1atime.struct_time(tm_year=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,\u00a0tm_mon=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>,\u00a0tm_mday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">25<\/span>,\u00a0tm_hour=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">0<\/span>,\u00a0tm_min=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">0<\/span>,\u00a0tm_sec=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">0<\/span>,\u00a0tm_wday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">4<\/span>,\u00a0tm_yday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">360<\/span>,\u00a0tm_isdst=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-1<\/span>)<br \/>\u5e74\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><br \/>\u6708\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span><br \/>\u65e5\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">25<\/span><br \/>\u661f\u671f\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">4<\/span><br \/>\u516c\u5386\u5e8f\u6570\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">737784<\/span><br \/>\u5e74\/\u5468\u6570\/\u661f\u671f\uff1a\u00a0(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">52<\/span>,\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">5<\/span>)<br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">2\u3001date\u7c7b\u4e2d\u65f6\u95f4\u548c\u65f6\u95f4\u6233\u7684\u8f6c\u6362\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/10-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5177\u4f53\u65f6\u95f4\u7684\u65f6\u95f4\u6233\u8f6c\u6210\u65e5\u671f\uff1a<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/8-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">3\u3001\u683c\u5f0f\u5316\u65f6\u95f4\u76f8\u5173\uff0c\u683c\u5f0f\u53c2\u7167time\u6a21\u5757\u4e2d\u7684strftime\u65b9\u6cd5<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">from<\/span>\u00a0datetime\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0datetime,\u00a0date,\u00a0time<br \/>today\u00a0=\u00a0date.today()<br \/><br \/>print(today)<br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a02020-12-26\u00a0\u00a0\u9ed8\u8ba4\u8fde\u63a5\u7b26\u53f7\u662f-<\/span><br \/><br \/>print(today.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y\/%m\/%d\"<\/span>))\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u6307\u5b9a\u8fde\u63a5\u7b26<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a02020\/12\/26<\/span><br \/><br \/>print(today.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y:%m:%d\"<\/span>))<br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a02020:12:26<\/span><br \/><br \/>print(today.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y\/%m\/%d\u00a0%H:%M:%S\"<\/span>))\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8f6c\u5316\u4e3a\u5177\u4f53\u7684\u65f6\u95f4<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a02020\/12\/26\u00a000:00:00<\/span><br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">4\u3001\u4fee\u6539\u65e5\u671f\u4f7f\u7528<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">replace<\/code>\u65b9\u6cd5<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/8-1610958983-1.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">4.3time<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time<\/code>\u7c7b\u4e5f\u662f\u8981\u751f\u6210<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time<\/code>\u5bf9\u8c61\uff0c\u5305\u542b<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">hour\u3001minute\u3001second\u3001microsecond<\/code>\uff0c\u6211\u4eec\u8fd8\u662f\u901a\u8fc7\u4f8b\u5b50\u6765\u5b66\u4e60\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">from<\/span>\u00a0datetime\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0time<br \/><br \/>t\u00a0=\u00a0time(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">10<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">20<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">30<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">40<\/span>)<br \/>print(t.hour)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u65f6\u5206\u79d2<\/span><br \/>print(t.minute)<br \/>print(t.second)<br \/>print(t.microsecond)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u5fae\u79d2<\/span><br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">10<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">20<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">30<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">40<\/span><br \/><\/code><\/pre>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">4.4datetime<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">datetime\u7c7b\u5305\u542bdate\u7c7b\u548ctime\u7c7b\u7684\u5168\u90e8\u4fe1\u606f\uff0c\u4e0b\u9762\ud83d\udc47\u662f\u7c7b\u65b9\u6cd5\u76f8\u5173\u7684\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">from<\/span>\u00a0\u00a0datetime\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0datetime<br \/><br \/>print(datetime.today())<br \/>print(datetime.now())<br \/>print(datetime.utcnow())<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u8fd4\u56de\u5f53\u524dUTC\u65e5\u671f\u548c\u65f6\u95f4\u7684datetime\u5bf9\u8c61<\/span><br \/>print(datetime.fromtimestamp(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">1697302830<\/span>))\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u65f6\u95f4\u6233\u7684datetime\u5bf9\u8c61<\/span><br \/>print(datetime.fromordinal(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">699000<\/span>)\u00a0)<br \/>print(datetime.combine(date(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">25<\/span>),\u00a0time(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">22<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">54<\/span>)))\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u62fc\u63a5\u65e5\u671f\u548c\u65f6\u95f4<\/span><br \/>print(datetime.strptime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"2020-12-25\"<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y-%m-%d\"<\/span>))<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">42.481845<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">42.482056<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">15<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">42.482140<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2023<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-10<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-15<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">01<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">30<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">1914<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-10<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-19<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">22<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">54<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span><br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u518d\u770b\u770b\u76f8\u5173\u5bf9\u8c61\u548c\u5c5e\u6027\u76f8\u5173\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">from<\/span>\u00a0datetime\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0datetime\u00a0<br \/><br \/>d\u00a0=\u00a0datetime(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">25<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>,<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span>)<br \/><br \/>print(d.date())<br \/>print(d.time())<br \/>print(d.timetz())\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u4ecedatetime\u4e2d\u62c6\u5206\u51fa\u5177\u4f53\u65f6\u533a\u5c5e\u6027\u7684time<\/span><br \/>print(d.replace(year=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2021<\/span>,month=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">1<\/span>))\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u66ff\u6362<\/span><br \/>print(d.timetuple())\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u65f6\u95f4\u5143\u7ec4<\/span><br \/>print(d.toordinal())\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u548cdate.toordinal\u4e00\u6837<\/span><br \/>print(d.weekday())<br \/>print(d.isoweekday())<br \/>print(d.isocalendar())<br \/>print(d.isoformat())<br \/>print(d.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y-%m-%d\u00a0:%H:%M:%S\"<\/span>))<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2021<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-01<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span><br \/>time.struct_time(tm_year=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,\u00a0tm_mon=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>,\u00a0tm_mday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">25<\/span>,\u00a0tm_hour=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>,\u00a0tm_min=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>,\u00a0tm_sec=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span>,\u00a0tm_wday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">4<\/span>,\u00a0tm_yday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">360<\/span>,\u00a0tm_isdst=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-1<\/span>)<br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">737784<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">4<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">5<\/span><br \/>(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">52<\/span>,\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">5<\/span>)<br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>T11:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-25<\/span>\u00a0:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">24<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">23<\/span><br \/><\/code><\/pre>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">4.5timedelta<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">timedelta<\/code>\u5bf9\u8c61\u8868\u793a\u7684\u662f\u4e00\u4e2a\u65f6\u95f4\u6bb5\uff0c\u5373\u4e24\u4e2a\u65e5\u671f<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">date<\/code>\u6216\u8005\u65e5\u671f\u65f6\u95f4<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">datetime<\/code>\u4e4b\u95f4\u7684\u5dee\uff1b\u652f\u6301\u53c2\u6570\uff1a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">weeks\u3001days\u3001hours\u3001minutes\u3001seconds\u3001milliseconds\u3001microseconds<\/code><\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/7-1610958983-1.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/0-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">4.6tzinfo<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u672c\u5730\u65f6\u95f4\u6307\u7684\u662f\u6211\u4eec\u7cfb\u7edf\u672c\u8eab\u8bbe\u5b9a\u65f6\u533a\u7684\u65f6\u95f4\uff0c\u4f8b\u5982\u4e2d\u56fd\u5904\u4e8e\u5317\u4eac\u65f6\u95f4\uff0c\u5e38\u8bf4\u7684\u4e1c\u516b\u533a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">UTC+8:00<\/code>\u3002<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">datetime<\/code>\u7c7b\u6709\u4e00\u4e2a\u65f6\u533a\u5c5e\u6027<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">tzinfo<\/code>\u3002<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\"><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">tzinfo<\/code>\u662f\u4e00\u4e2a\u5173\u4e8e\u65f6\u533a\u4fe1\u606f\u7684\u7c7b\uff0c\u662f\u4e00\u4e2a\u62bd\u8c61\u7684\u57fa\u7c7b\uff0c\u4e0d\u80fd\u76f4\u63a5\u88ab\u5b9e\u4f8b\u5316\u6765\u4f7f\u7528\u3002\u5b83\u7684\u9ed8\u8ba4\u503c\u662f<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">None<\/code>\uff0c\u65e0\u6cd5\u533a\u5206\u5177\u4f53\u662f\u54ea\u4e2a\u65f6\u533a\uff0c\u9700\u8981\u6211\u4eec\u5f3a\u5236\u6307\u5b9a\u4e00\u4e2a\u4e4b\u540e\u624d\u80fd\u4f7f\u7528\u3002<\/p>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/9-1610958983-2.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u56e0\u4e3a\u672c\u8eab\u7cfb\u7edf\u7684\u65f6\u533a\u521a\u597d\u5728\u4e2d\u56fd\u5904\u4e8e\u4e1c\u516b\u533a\uff0c\u6240\u4ee5\u4e0a\u8ff0\u4ee3\u7801\u662f\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u7684\uff0c\u7ed3\u679c\u4e5f\u662fOK\u7684\u3002\u90a3\u5982\u679c\u6211\u4eec\u60f3\u5207\u6362\u5230\u5176\u4ed6\u65f6\u533a\u7684\u65f6\u95f4\uff0c\u8be5\u5982\u4f55\u64cd\u4f5c\u5462\uff1f\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u9700\u8981\u8fdb\u884c\u65f6\u533a\u7684\u5207\u6362\u3002<\/p>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">1\u3001\u6211\u4eec\u5148\u901a\u8fc7<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">utcnow()<\/code>\u83b7\u53d6\u5230\u5f53\u524d\u7684UTC\u65f6\u95f4<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\">utc_now\u00a0=\u00a0datetime.utcnow().replace(tzinfo=timezone.utc)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u6307\u5b9autc\u65f6\u533a<\/span><br \/>print(utc_now)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-26<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">01<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">36<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">33.975427<\/span>+<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span><br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">2\u3001\u901a\u8fc7<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">astimezone()<\/code>\u5c06\u65f6\u533a\u6307\u5b9a\u4e3a\u6211\u4eec\u60f3\u8f6c\u6362\u7684\u65f6\u533a\uff0c\u6bd4\u5982\u4e1c\u516b\u533a\uff08\u5317\u4eac\u65f6\u95f4\uff09\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u901a\u8fc7astimezone\u5207\u6362\u5230\u4e1c\u516b\u533a<\/span><br \/><br \/>beijing\u00a0=\u00a0utc_now.astimezone(timezone(timedelta(hours=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">8<\/span>)))<br \/>print(beijing)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-26<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">09<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">36<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">33.975427<\/span>+<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">08<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span><br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u7528\u540c\u6837\u7684\u65b9\u6cd5\u5207\u5230\u4e1c\u4e5d\u533a\uff0c\u4e1c\u4eac\u65f6\u95f4\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\"># UTC\u65f6\u533a\u5207\u6362\u5230\u4e1c\u4e5d\u533a\uff1a\u4e1c\u4eac\u65f6\u95f4<\/span><br \/><br \/>tokyo\u00a0=\u00a0utc_now.astimezone(timezone(timedelta(hours=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">9<\/span>)))<br \/>print(tokyo)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-26<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">10<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">36<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">33.975427<\/span>+<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">09<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span><br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u8fd8\u53ef\u4ee5<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u76f4\u63a5\u4ece\u5317\u4eac\u65f6\u95f4\u5207\u6362\u5230\u4e1c\u4eac\u65f6\u95f4<\/strong>\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u5317\u4eac\u65f6\u95f4\uff08\u4e1c\u516b\u533a\uff09\u76f4\u63a5\u5207\u6362\u5230\u4e1c\u4eac\u65f6\u95f4\uff08\u4e1c\u4e5d\u533a\uff09<\/span><br \/><br \/>tokyo_new\u00a0=\u00a0beijing.astimezone(timezone(timedelta(hours=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">9<\/span>)))<br \/>print(tokyo_new)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-26<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">10<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">36<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">33.975427<\/span>+<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">09<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">00<\/span><br \/><\/code><\/pre>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/6-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h2 style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.2em; border-bottom: 1.5px solid #ec4444;\"><span style=\"font-size: inherit; line-height: inherit; display: inline-block; font-weight: normal; background: #ec4444; color: #ffffff; padding-top: 3px; padding-right: 10px; padding-left: 10px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">5.\u5e38\u7528\u65f6\u95f4\u8f6c\u5316<\/span><\/h2>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u4e0b\u9762\u4ecb\u7ecd\u51e0\u4e2a\u5de5\u4f5c\u4e2d\u7528\u5230\u7684\u65f6\u95f4\u8f6c\u5316\u5c0f\u6280\u5de7\uff1a<\/p>\n<ol class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u65f6\u95f4\u6233\u8f6c\u65e5\u671f<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u65e5\u671f\u8f6c\u65f6\u95f4\u6233<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u683c\u5f0f\u5316\u65f6\u95f4<\/span><\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">\u6307\u5b9a\u683c\u5f0f\u83b7\u53d6\u5f53\u524d\u65f6\u95f4<\/span><\/p>\n<\/li>\n<\/ol>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">5.1\u65f6\u95f4\u6233\u8f6c\u6210\u65e5\u671f<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u65f6\u95f4\u6233\u8f6c\u6210\u5177\u4f53\u65f6\u95f4\uff0c\u6211\u4eec\u9700\u8981\u4e24\u4e2a\u51fd\u6570\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.localtime<\/code>\uff1a\u5c06\u65f6\u95f4\u6233\u8f6c\u6210\u65f6\u95f4\u5143\u7ec4\u5f62\u5f0f<\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.strftime<\/code>\uff1a\u5c06\u65f6\u95f4\u5143\u7ec4\u6570\u636e\u8f6c\u6210\u6211\u4eec\u9700\u8981\u7684\u5f62\u5f0f<\/p>\n<\/li>\n<\/ul>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0time<br \/>now_timestamp\u00a0=\u00a0time.time()\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233<\/span><br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u65f6\u95f4\u6233\u5148\u8f6c\u6210\u65f6\u95f4\u5143\u7ec4\uff0cstrftime\u5728\u8f6c\u6210\u6307\u5b9a\u683c\u5f0f<\/span><br \/>now_tuple\u00a0=\u00a0time.localtime(now_timestamp)<br \/>time.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y\/%m\/%d\u00a0%H:%M:%S\"<\/span>,\u00a0now_tuple)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">'2020\/12\/26\u00a011:19:01'<\/span><br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5047\u8bbe\u6211\u4eec<strong style=\"font-size: inherit; line-height: inherit; color: #ff3502;\">\u6307\u5b9a\u4e00\u4e2a\u5177\u4f53\u7684\u65f6\u95f4\u6233<\/strong>\u6765\u8fdb\u884c\u8f6c\u6362\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0time<br \/>timestamp\u00a0=\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">1608852741<\/span>\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u6307\u5b9a\u65f6\u95f4\u6233<\/span><br \/><br \/>a\u00a0=\u00a0time.localtime(timestamp)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u83b7\u5f97\u65f6\u95f4\u5143\u7ec4\u5f62\u5f0f\u6570\u636e<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u65f6\u95f4\u5143\u7ec4\u6570\u636e\uff1a\"<\/span>,a)<br \/>time.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y\/%m\/%d\u00a0%H:%M:%S\"<\/span>,\u00a0a)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u683c\u5f0f\u5316<\/span><br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/>\u65f6\u95f4\u5143\u7ec4\u6570\u636e\uff1atime.struct_time(tm_year=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,\u00a0tm_mon=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>,\u00a0tm_mday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">25<\/span>,\u00a0tm_hour=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">7<\/span>,\u00a0tm_min=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">32<\/span>,\u00a0tm_sec=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">21<\/span>,\u00a0tm_wday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">4<\/span>,\u00a0tm_yday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">360<\/span>,\u00a0tm_isdst=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">0<\/span>)<br \/><span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">'2020\/12\/25\u00a007:32:21'<\/span><br \/><\/code><\/pre>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5982\u679c\u6211\u4eec\u4e0d\u60f3\u6307\u5b9a\u5177\u4f53\u7684\u683c\u5f0f\uff0c\u53ea\u60f3\u83b7\u53d6\u65f6\u95f4\u6233\u5bf9\u5e94\u7684\u65f6\u95f4\uff0c\u76f4\u63a5\u901a\u8fc7<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.ctime<\/code>\u5373\u53ef\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0time<br \/>time.ctime(<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">1608852741<\/span>)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">'Fri\u00a0Dec\u00a025\u00a007:32:21\u00a02020'<\/span><br \/><\/code><\/pre>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">5.2\u65e5\u671f\u65f6\u95f4\u8f6c\u6210\u65f6\u95f4\u6233<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u65e5\u671f\u65f6\u95f4\u8f6c\u6210\u65f6\u95f4\u6233\u683c\u5f0f\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u4e24\u4e2a\u65b9\u6cd5\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">strptime()<\/code>\uff1a\u5c06\u65f6\u95f4\u8f6c\u6362\u6210\u65f6\u95f4\u6570\u7ec4<\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">mktime()<\/code>\uff1a\u5c06\u65f6\u95f4\u6570\u7ec4\u8f6c\u6362\u6210\u65f6\u95f4\u6233<\/p>\n<\/li>\n<\/ul>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u901a\u8fc7\u5177\u4f53\u7684\u6848\u4f8b\u6765\u5b66\u4e60\u4e00\u4e0b\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\">date\u00a0=\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"2020-12-26\u00a011:45:34\"<\/span><br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a01\u3001\u65f6\u95f4\u5b57\u7b26\u4e32\u8f6c\u6210\u65f6\u95f4\u6570\u7ec4\u5f62\u5f0f<\/span><br \/>date_array\u00a0=\u00a0time.strptime(date,\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y-%m-%d\u00a0%H:%M:%S\"<\/span>)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a02\u3001\u67e5\u770b\u65f6\u95f4\u6570\u7ec4\u6570\u636e<\/span><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u65f6\u95f4\u6570\u7ec4\uff1a\"<\/span>,\u00a0date_array)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a03\u3001mktime\u65f6\u95f4\u6570\u7ec4\u8f6c\u6210\u65f6\u95f4\u6233<\/span><br \/>time.mktime(date_array)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/>\u65f6\u95f4\u6570\u7ec4\uff1atime.struct_time(tm_year=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>,\u00a0tm_mon=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>,\u00a0tm_mday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">26<\/span>,\u00a0tm_hour=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>,\u00a0tm_min=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">45<\/span>,\u00a0tm_sec=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">34<\/span>,\u00a0tm_wday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">5<\/span>,\u00a0tm_yday=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">361<\/span>,\u00a0tm_isdst=<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-1<\/span>)<br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">1608954334.0<\/span><br \/><\/code><\/pre>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/5-1610958983.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">5.3\u683c\u5f0f\u5316\u65f6\u95f4<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u5de5\u4f5c\u9700\u6c42\u4e2d\u6709\u65f6\u5019\u7ed9\u5b9a\u7684\u65f6\u95f4\u683c\u5f0f\u672a\u5fc5\u662f\u6211\u4eec\u80fd\u591f\u76f4\u63a5\u4f7f\u7528\uff0c\u6240\u4ee5\u53ef\u80fd\u9700\u8981\u8fdb\u884c\u683c\u5f0f\u7684\u8f6c\u6362\uff0c\u9700\u8981\u4f7f\u7528\u4e24\u4e2a\u65b9\u6cd5\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">strptime()<\/code>\uff1a\u5c06\u65f6\u95f4\u8f6c\u6362\u6210\u65f6\u95f4\u6570\u7ec4<\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">strftime()<\/code>\uff1a\u91cd\u65b0\u683c\u5f0f\u5316\u65f6\u95f4<\/p>\n<\/li>\n<\/ul>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u901a\u8fc7\u6848\u4f8b\u6765\u8fdb\u884c\u5b66\u4e60\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #b294bb; overflow-wrap: inherit !important; word-break: inherit !important;\">import<\/span>\u00a0time<br \/><br \/>old\u00a0=\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"2020-12-12\u00a012:28:45\"<\/span><br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a01\u3001\u8f6c\u6362\u6210\u65f6\u95f4\u6570\u7ec4<\/span><br \/>time_array\u00a0=\u00a0time.strptime(old,\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y-%m-%d\u00a0%H:%M:%S\"<\/span>)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a02\u3001\u8f6c\u6362\u6210\u65b0\u7684\u65f6\u95f4\u683c\u5f0f(20201212-20:28:54)<\/span><br \/>new\u00a0=\u00a0time.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y%m%d-%H:%M:%S\"<\/span>,time_array)\u00a0\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u6307\u5b9a\u663e\u793a\u683c\u5f0f<\/span><br \/><br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u539f\u683c\u5f0f\u65f6\u95f4\uff1a\"<\/span>,old)<br \/>print(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"\u65b0\u683c\u5f0f\u65f6\u95f4\uff1a\"<\/span>,new)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/>\u539f\u683c\u5f0f\u65f6\u95f4\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">28<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">45<\/span><br \/>\u65b0\u683c\u5f0f\u65f6\u95f4\uff1a\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">20201212<\/span><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">-12<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">28<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">45<\/span><br \/><\/code><\/pre>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><\/figure>\n<figure style=\"font-size: inherit; color: inherit; line-height: inherit;\"><img decoding=\"async\" style=\"font-size: inherit; color: inherit; line-height: inherit; display: block; margin-right: auto; margin-left: auto; border-radius: 5px; border: 1px solid gray;\" title=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2021\/01\/7-1610958983-2.jpeg\" alt=\"Python \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\" \/><\/figure>\n<h3 style=\"line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.1em; color: #e4470a;\"><span style=\"font-size: inherit; color: inherit; line-height: inherit;\">5.4\u6307\u5b9a\u683c\u5f0f\u83b7\u53d6\u5f53\u524d\u65f6\u95f4<\/span><\/h3>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u4e3a\u4e86\u80fd\u591f\u83b7\u53d6\u5230\u6307\u5b9a\u683c\u5f0f\u7684\u5f53\u524d\u65f6\u95f4\uff0c\u6211\u4eec\u5206\u4e3a3\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"font-size: inherit; color: inherit; line-height: inherit; padding-left: 32px;\">\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.time()<\/code>\uff1a\u83b7\u53d6\u5f53\u524d\u65f6\u95f4<\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.localtime()<\/code>\uff1a\u8f6c\u6210\u65f6\u95f4\u5143\u7ec4<\/p>\n<\/li>\n<li style=\"font-size: inherit; color: inherit; line-height: inherit; margin-bottom: 0.5em;\">\n<p><code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">time.strftime()<\/code>\uff1a\u91cd\u65b0\u683c\u5f0f\u5316\u65f6\u95f4<\/p>\n<\/li>\n<\/ul>\n<p style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-size: 15px;\">\u901a\u8fc7\u4e00\u4e2a\u6848\u4f8b\u6765\u5b66\u4e60\uff1a<\/p>\n<pre style=\"font-size: inherit; color: inherit; line-height: inherit;\"><code style=\"margin-right: 2px; margin-left: 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 5px; background: #1d1f21; color: #c5c8c6; padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;\"><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a01\u3001\u65f6\u95f4\u6233<\/span><br \/>old_time\u00a0=\u00a0time.time()<br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a02\u3001\u65f6\u95f4\u5143\u7ec4<\/span><br \/>time_array\u00a0=\u00a0time.localtime(old_time)<br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a03\u3001\u6307\u5b9a\u683c\u5f0f\u8f93\u51fa<\/span><br \/>new_time\u00a0=\u00a0time.strftime(<span style=\"font-size: inherit; line-height: inherit; color: #b5bd68; overflow-wrap: inherit !important; word-break: inherit !important;\">\"%Y\/%m\/%d\u00a0%H:%M:%S\"<\/span>,\u00a0time_array)<br \/>print(new_time)<br \/><br \/><span style=\"font-size: inherit; line-height: inherit; color: #969896; overflow-wrap: inherit !important; word-break: inherit !important;\">#\u00a0\u7ed3\u679c<\/span><br \/><span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">2020<\/span>\/<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">12<\/span>\/<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">26<\/span>\u00a0<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">11<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">56<\/span>:<span style=\"font-size: inherit; line-height: inherit; color: #de935f; overflow-wrap: inherit !important; word-break: inherit !important;\">08<\/span><br \/><\/code><\/pre>\n<h2 style=\"color: inherit; line-height: inherit; margin-top: 1.5em; margin-bottom: 1.5em; font-weight: bold; font-size: 1.2em; border-bottom: 1.5px solid #ec4444;\"><span style=\"font-size: inherit; line-height: inherit; display: inline-block; font-weight: normal; background: #ec4444; color: #ffffff; padding-top: 3px; padding-right: 10px; padding-left: 10px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">6.\u603b\u7ed3<\/span><\/h2>\n<section style=\"color: inherit; line-height: inherit; margin-top: 1.5em; font-size: 15px; margin-bottom: 10px;\">\u672c\u6587\u901a\u8fc7\u5404\u79cd\u6848\u4f8b\u8be6\u7ec6\u4ecb\u7ecd\u4e86<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">Python<\/code>\u4e2d\u5173\u4e8e\u65f6\u95f4\u8f93\u51fa\u548c\u8f6c\u5316\u76843\u4e2a\u6a21\u5757\uff1a<code style=\"font-size: inherit; line-height: inherit; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; color: #e96900; background: #f8f8f8;\">calendar\u3001time\u3001datetime<\/code>\uff0c\u6700\u540e\u603b\u7ed3\u4e864\u4e2a\u5de5\u4f5c\u4e2d\u5e38\u7528\u7684\u65f6\u95f4\u8f6c\u5316\u6280\u5de7\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u638c\u63e1Python\u4e2d\u7684\u65f6\u95f4\u8f93\u51fa\u548c\u8f6c\u5316\u6709\u6240\u5e2e\u52a9\uff0c\u4e0d\u518d\u88ab\u65f6\u95f4\u56f0\u6270\u3002<\/section>\n<\/section>\n<section style=\"white-space: normal; max-width: 100%; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 15px; color: #3e3e3e; line-height: 1.8; word-spacing: 1.6px; letter-spacing: 0.5px; box-sizing: border-box !important; overflow-wrap: break-word !important;\"><\/section>\n<\/div>\n\n\n<p>\u8f6c\u81ea\uff1ahttps:\/\/mp.weixin.qq.com\/s\/LRSMG9WDTBIyAecZqbjgAA<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u4f5c\u8005\uff1aPeter\u6765\u6e90\uff1aPython\u7f16\u7a0b\u65f6\u5149 \u5728\u751f\u6d3b\u548c\u5de5\u4f5c\u4e2d\uff0c\u6211\u4eec\u6bcf\u4e2a\u4eba\u6bcf\u5929\u90fd\u5728\u548c\u65f6\u95f4\u6253\u4ea4\u9053\uff1a \u65e9\u4e0a\u4ec0\u4e48\u65f6\u5019 &hellip; <a href=\"http:\/\/www.zhushiyao.com\/?p=53651\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cPython \u65f6\u95f4\u683c\u5f0f\u64cd\u4f5c\u603b\u7ed3\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[8],"_links":{"self":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/53651"}],"collection":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=53651"}],"version-history":[{"count":2,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/53651\/revisions"}],"predecessor-version":[{"id":53698,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/53651\/revisions\/53698"}],"wp:attachment":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=53651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=53651"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=53651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}