Data360 Analyze

Welcome to the Data360 Analyze community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  using "strptime"...

    Posted 07-19-2019 03:54

    Hi all
    Does anyone know how the "strptime" function works to define the century when it's missing in data source?

    For example:
    DateDOB = datetime.datetime.strptime(StrDOB,” %y-%m-%d “]).date()

    I got as result:
    StrDOB                 DateDOB          FYI Year Value (ID card check )
    76-10-19              1976-10-19         1976
    75-04-30              1975-04-30         1975
    66-01-18              2066-01-18         1966 <- Any thoughts or suggestions?

     



  • 2.  RE: using "strptime"...

    Employee
    Posted 07-19-2019 06:35

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    It looks like Pythons switches it at 1969 so you'll have to handle anything by parsing out the year and adding a 19 or 20 as appropriate. Have a look this link.

     



  • 3.  RE: using "strptime"...

    Posted 07-19-2019 07:17

    Thanks Gerry :-)
    Weird behavior and really boring...