python - 根据时间戳获取当前格式化时间

python - 根据时间戳获取当前格式化时间

代码截图

In [1]: import time

In [2]: now_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))

In [3]: now_time
Out[3]: '2018-01-02 16:30:16'

猜你喜欢

转载自blog.csdn.net/xuezhangjun0121/article/details/78953123