0

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?

Montel Edwards
  • 400
  • 5
  • 14
  • 3
    Possible duplicate of [How to parse an ISO 8601-formatted date?](https://stackoverflow.com/questions/127803/how-to-parse-an-iso-8601-formatted-date) – Matt Johnson-Pint Jun 28 '17 at 02:31

1 Answers1

0

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.

hxysayhi
  • 1,888
  • 18
  • 25