应用中有时需要查看一下服务当前时间,代码如下:
#!/usr/bin/env python # _*_ coding: utf-8 _*_ import time print time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())