Skip to content

Instantly share code, notes, and snippets.

@sirex
Created September 1, 2020 07:02
Show Gist options
  • Save sirex/f8b48e2800891fae8166cb45c4f2a7e0 to your computer and use it in GitHub Desktop.
Save sirex/f8b48e2800891fae8166cb45c4f2a7e0 to your computer and use it in GitHub Desktop.
import dateutil.parser
class LtParserInfo(dateutil.parser.parserinfo):
WEEKDAYS = [
("Pr", "Pirmadienis"),
("An", "Antradienis"),
("Tr", "Trečiadienis"),
("Kv", "Ketvirtadienis"),
("Pn", "Penktadienis"),
("Št", "Šeštadienis"),
("Sk", "Sekmadienis"),
]
MONTHS = [
("Sau", "Sausis"),
("Vas", "Vasaris"),
("Kov", "Kovas"),
("Bal", "Balandis"),
("Geg", "Gegužė"),
("Bir", "Birželis"),
("Lie", "Liepa"),
("Rgp", "Rugpjūtis"),
("Rgs", "Rugsėjis"),
("Spa", "Spalis"),
("Lap", "Lapkritis"),
("Gru", "Gruodis"),
]
d = 'Pr, 31 Rgp 2020 16:43:35 +0300'
dateutil.parser.parse(d, parserinfo=LtParserInfo())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment