编程大白的博客

Python datetime去除毫秒 返回当前时间

datetime模块返回当前时间

转载链接:python datetime去除毫秒

参考链接:datetime的使用

import datetime

if __name__ == '__main__':
    a = datetime.datetime.now().replace(microsecond=0)
    print(a, type(a))

运算结果:
2020-05-22 12:13:42 <class 'datetime.datetime'>
Process finished with exit code 0
« Previous

Nmap常用参数

Next »

函数指针求三个数最大值

© 2024 编程大白的博客. Generated with Hugo and Mainroad theme.