如何更改日期时间分辨率?

有没有简单的方法可以说明

a = '2020-01-01 19:30:33.996628' 
b = '2020-01-01 19:30:34' 

a and b are equal. If the time resolution of a is changed to second, then a could be equal to b. How to implement it with code?