\n4<\/td>\n | time.ctime([secs]) \n\u4f5c\u7528\u76f8\u5f53\u4e8easctime(localtime(secs))\uff0c\u672a\u7ed9\u53c2\u6570\u76f8\u5f53\u4e8easctime()<\/td>\n | \u4ee5\u4e0b\u5b9e\u4f8b\u5c55\u793a\u4e86 ctime()\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n>>><\/span> import<\/span> time\r\n<\/span>>>><\/span> print<\/span> (<\/span>\"time.ctime() : %s\"<\/span> %<\/span> time<\/span>.<\/span>ctime<\/span>())<\/span>\r\ntime<\/span>.<\/span>ctime<\/span>()<\/span> :<\/span> Thu<\/span> Apr<\/span> 7<\/span> 10<\/span>:<\/span>51<\/span>:<\/span>58<\/span> 2016<\/span><\/pre>\n<\/td>\n<\/tr>\n\n5<\/td>\n | time.gmtime([secs]) \n\u63a5\u6536\u65f6\u95f4\u6233\uff081970\u7eaa\u5143\u540e\u7ecf\u8fc7\u7684\u6d6e\u70b9\u79d2\u6570\uff09\u5e76\u8fd4\u56de\u683c\u6797\u5a01\u6cbb\u5929\u6587\u65f6\u95f4\u4e0b\u7684\u65f6\u95f4\u5143\u7ec4t\u3002\u6ce8\uff1at.tm_isdst\u59cb\u7ec8\u4e3a0<\/td>\n | \u4ee5\u4e0b\u5b9e\u4f8b\u5c55\u793a\u4e86 gmtime()\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n>>><\/span> import<\/span> time\r\n<\/span>>>><\/span> print<\/span> (<\/span>\"gmtime :\"<\/span>,<\/span> time<\/span>.<\/span>gmtime<\/span>(<\/span>1455508609.34375<\/span>))<\/span>\r\ngmtime <\/span>:<\/span> time<\/span>.<\/span>struct_time<\/span>(<\/span>tm_year<\/span>=<\/span>2016<\/span>,<\/span> tm_mon<\/span>=<\/span>2<\/span>,<\/span> tm_mday<\/span>=<\/span>15<\/span>,<\/span> tm_hour<\/span>=<\/span>3<\/span>,<\/span> tm_min<\/span>=<\/span>56<\/span>,<\/span> tm_sec<\/span>=<\/span>49<\/span>,<\/span> tm_wday<\/span>=<\/span>0<\/span>,<\/span> tm_yday<\/span>=<\/span>46<\/span>,<\/span> tm_isdst<\/span>=<\/span>0<\/span>)<\/span><\/pre>\n<\/td>\n<\/tr>\n\n6<\/td>\n | time.localtime([secs] \n\u63a5\u6536\u65f6\u95f4\u6233\uff081970\u7eaa\u5143\u540e\u7ecf\u8fc7\u7684\u6d6e\u70b9\u79d2\u6570\uff09\u5e76\u8fd4\u56de\u5f53\u5730\u65f6\u95f4\u4e0b\u7684\u65f6\u95f4\u5143\u7ec4t\uff08t.tm_isdst\u53ef\u53d60\u62161\uff0c\u53d6\u51b3\u4e8e\u5f53\u5730\u5f53\u65f6\u662f\u4e0d\u662f\u590f\u4ee4\u65f6\uff09\u3002<\/td>\n | \u4ee5\u4e0b\u5b9e\u4f8b\u5c55\u793a\u4e86 localtime()\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n>>><\/span> import<\/span> time\r\n<\/span>>>><\/span> print<\/span> (<\/span>\"localtime(): \"<\/span>,<\/span> time<\/span>.<\/span>localtime<\/span>(<\/span>1455508609.34375<\/span>))<\/span>\r\nlocaltime<\/span>():<\/span> time<\/span>.<\/span>struct_time<\/span>(<\/span>tm_year<\/span>=<\/span>2016<\/span>,<\/span> tm_mon<\/span>=<\/span>2<\/span>,<\/span> tm_mday<\/span>=<\/span>15<\/span>,<\/span> tm_hour<\/span>=<\/span>11<\/span>,<\/span> tm_min<\/span>=<\/span>56<\/span>,<\/span> tm_sec<\/span>=<\/span>49<\/span>,<\/span> tm_wday<\/span>=<\/span>0<\/span>,<\/span> tm_yday<\/span>=<\/span>46<\/span>,<\/span> tm_isdst<\/span>=<\/span>0<\/span>)<\/span><\/pre>\n<\/td>\n<\/tr>\n\n7<\/td>\n | time.mktime(tupletime)<\/a> \n\u63a5\u53d7\u65f6\u95f4\u5143\u7ec4\u5e76\u8fd4\u56de\u65f6\u95f4\u6233\uff081970\u7eaa\u5143\u540e\u7ecf\u8fc7\u7684\u6d6e\u70b9\u79d2\u6570\uff09\u3002<\/td>\n | \u5b9e\u4f8b<\/a><\/td>\n<\/tr>\n\n8<\/td>\n | time.sleep(secs) \n\u63a8\u8fdf\u8c03\u7528\u7ebf\u7a0b\u7684\u8fd0\u884c\uff0csecs\u6307\u79d2\u6570\u3002<\/td>\n | \u4ee5\u4e0b\u5b9e\u4f8b\u5c55\u793a\u4e86 sleep()\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n#!\/usr\/bin\/python3<\/span>\r\nimport<\/span> time\r\n\r\n<\/span>print<\/span> (<\/span>\"Start : %s\"<\/span> %<\/span> time<\/span>.<\/span>ctime<\/span>())<\/span>\r\ntime<\/span>.<\/span>sleep<\/span>(<\/span> 5<\/span> )<\/span>\r\nprint<\/span> (<\/span>\"End : %s\"<\/span> %<\/span> time<\/span>.<\/span>ctime<\/span>())<\/span><\/pre>\n<\/td>\n<\/tr>\n\n9<\/td>\n | time.strftime(fmt[,tupletime]) | | | | | |