python datetime object 去除毫秒(microsecond)

1 >>>import datetime 
2 >>>d = datetime.datetime.now().replace(microsecond=0) 
3 >>>d 
4 datetime.datetime(2019, 4, 2, 15, 55, 18)

 

posted @ 2019-04-02 16:03  琵琶真的行  阅读(7507)  评论(0编辑  收藏  举报