from datetime import datetime microsecond = '1' dt = datetime.strptime(microsecond, '%f') print(dt)