Using Python dateutil to get Large Date Offsets

From PeformIQ Upgrade
Revision as of 15:02, 12 January 2014 by PeterHarding (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

My program reads six digit dates, yymmdd, as 19yymmdd. I adjust these 19yymmdd dates to 20yymmdd as follows:

        self.DoB = datetime.strptime(line[27:35], "%Y%m%d")

        if self.DoB < datetime(2000, 01, 01):
            self.DoB += relativedelta(years=100)