Question on formatting when converting Pyside QDateTime data to String

77 Views Asked by At

here is my test code,

            utc_fmt = "yyyy/MM/dd hh:mm:ss.zzzzzz"
            new_date = QDateTime().fromString("2023/01/01 20:19:18.171123", utc_fmt)
            debug =new_date.toString("yyyy/MM/dd hh:mm:ss.zzzzzz")
            print("time:"+debug)

conversion seems failed,

When I changed the format to

utc_fmt = "yyyy/MM/dd hh:mm:ss.zzz"
#...
debug =new_date.toString("yyyy/MM/dd hh:mm:ss.zzz")

conversion succeeded.

Does that mean QDateTime will not support ss.zzzzzz(six digits after point, microseonds)?

0

There are 0 best solutions below