简体   繁体   中英

Python-Saml unable to Parse time - What time format is this?

I'm working with python-saml and Azure AD B2C SAML-RP (experimental) and the assertion from Azure is throwing python-saml an error. Is the formatting from Azure off?

time data '2017-06-28T02:19:59.1690618Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

I see there is a solution to this at How to parse an ISO 8601-formatted date?

However, can you please explain for my understanding why this time does not match the format the python-saml library is looking for? What is the current format called? What is the format the library looking for? What is the difference?

In '2017-06-28T02:19:59.1690618Z' , the '1690618' is more than 6 digits,then it can't match '%fZ'

As you can see in https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior

%f is an extension to the set of format characters in the C standard (but implemented separately in datetime objects, and therefore always available). When used with the strptime() method, the %f directive accepts from one to six digits and zero pads on the right.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM