Package: python-datetimeparser
datetimeparserA python parser library made for parsing english language into datetime objectsmade with ❤️ byaridevelopment.deReport an issue·Request a new featureAbout The ProjectDatetimeparser is a python library capable of parsing the english language into datetime objects.It was created due to the lack of such library and need for it. We knew that there wasdateutilbut we wanted a more powerful parsing library.Datetimeparser can even parse complex grammar and sentence structure.Latest ChangeExamplesBelow you can find some examples of how datetimeparser can be used.fromdatetimeparserimportparseprint(parse("next 3 years and 2 months"))# 2025-04-06 11:43:28print(parse("begin of advent of code 2022"))# 2022-12-01 06:00:00print(parse("in 1 Year 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds"))# 2023-05-01 17:59:52print(parse("10 days and 2 hours after 3 months before christmas 2020"))# 2020-10-05 02:00:00InstallationUse pip to install the library:$pipinstallpython-datetimeparserContributingIf you want to contribute to datetimeparser, please use feature branches. If possible, name them after an already opened issue (e.g. feature/131).We highly appreciate everyone who wants to help our project!List of ConstantsAll Normal-Constantschristmasxmassilvesternew years eveeasterneasternicholasnicholas dayhalloweenapril fools dayapril fool daythanksgivingsaint patrick's daysaint patricks dayst. patrick's daysaint pt. dayst patrick's dayst patricks dayvalentines dayvalentinevalentine daysummer endend of summerend of the summerwinter endend of winterend of the winterspring endend of springend of the springfall endend of fallend of the fallautumn endend of autumnend of the autumnsummer beginsummerbegin of summerbegin of the summerwinter beginwinterbegin of winterbegin of the winterspring beginspringbegin of springbegin of the springfall beginfallbegin of fallbegin of the fallautumn beginautumnbegin of autumnbegin of the autumnmorningat morningeveningat eveninglunchtimelunchaoc beginaocbegin of aocbegin of the aocadvent of code beginadvent of codebegin of advent of codebegin of the advent of codeaoc endend of aocend of the aocadvent of code endend of advent of codeend of the advent of codeend of yearthe end of yearthe end of the yearend of the yearbegin of yearthe begin of yearthe begin of the yearbegin of the yearinfinityinftodaytomorrowyesterdaynowat the momentcurrent timecurrent time nowAll Day-Constantsmorningafternooneveningnightmorning nightdaylight changedaylight savingdaylight saving timemidnightmiddaydawndusksunrisesunsetlunchlunchtimedinnerdinnertimebreakfastAll Weekday-ConstantsmondaytuesdaywednesdaythursdayfridaysaturdaysundayAll Month-ConstantsjanuaryjanfebruaryfebmarchmaraprilaprmayjunejunjulyjulaugustaugseptembersepoctoberoctnovembernovdecemberdecAll Datetime-ConstantssecondssecondsecsecsminutesminuteminminshourshourdaysdayweeksweekmonthsmonthyearsyearAll Number-Constantsthirty onethirtyonethirty-onethirtytwenty ninetwentyninetwenty-ninetwenty eighttwentyeighttwenty-eighttwenty seventwentyseventwenty-seventwenty sixtwentysixtwenty-sixtwenty fivetwentyfivetwenty-fivetwenty fourtwentyfourtwenty-fourtwenty threetwentythreetwenty-threetwenty twotwentytwotwenty-twotwenty onetwentyonetwenty-onetwentynineteeneighteenseventeensixteenfifteenfourteenthirteentwelveeleventennineeightsevensixfivefourthreetwooneAll NumberCount-Constantsthirty first31st31.thirthyfirstthirty-firstthirtieth30th30.twenty ninth29th29.twentyninthtwenty-ninthtwenty eighth28th28.twentyeighthtwenty-eighthtwenty seventh27th27.twentyseventhtwenty-seventhtwenty sixth26th26.twentysixthtwenty-sixthtwenty fifth25th25.twentyfifthtwenty-fifthtwenty fourth24th24.twentyfourthtwenty-fourthtwenty third23rd23.twentythirdtwenty-thirdtwenty second22nd22.twentysecondtwenty-secondtwenty first21st21.twentyfirsttwenty-firsttwentieth20th20.nineteenth19th19.eighteenth18th18.seventeenth17th17.sixteenth16th16.fifteenth15th15.fourteenth14th14.thirteenth13th13.twelfth12th12.eleventh11th11.tenth10th10.ninth9th9.eighth8th8.seventh7th7.sixth6th6.fifth5th5.fourth4th4.third3rd3.second2nd2.first1st1.