python脚本工具 - 4 获取系统当前时间

#! /usr/bin/python

import time

current_time = time.strftime("%Y-%m-%d %H:%M")

print current_time

结果:

spdbmadeMacBook-Pro:python spdbma$ ./test.py 
2016-03-18 14:42
原文地址:https://www.cnblogs.com/tdcqma/p/5292042.html