- try:
- t = time.strptime(text, '%Y-%m-%d')
- except ValueError:
- t = time.strptime(text, '%Y')
+ # check out the "N. poł X w." syntax
+ m = re.match(u"([12]) *poł[.]? ([MCDXVI]+) .*[.]?", text)
+ if m:
+ half = int(m.groups()[0])
+ century = roman_to_int(str(m.groups()[1]))
+ t = ((century*100 + (half-1)*50), 1, 1)
+ else:
+ try:
+ t = time.strptime(text, '%Y-%m-%d')
+ except ValueError:
+ t = time.strptime(text, '%Y')