先转换成本地时间再格式化 timezone.localtime() 最终代码: timezone.localtime(file.created).strftime("%Y-%m-%d %H:%M:%S")