Package: text2datetime
Python module which can convert an extensive number of ways to represent time with strings to datetime objectsSome examples include:“Tomorrow 5:00AM” - for tomorrow at 5am“+3yr +2d” - For three years and two days in future“-5mo 16:00” - For 5 months ago at 16:00 hours (4PM)“1/8/2015” - Depending on monthBeforeDate flag, could be Jan 8th or August 1st, 2015.The primary function which supports converting all of these various texts istext2datetime.text2datetimetext2datetime methoddef text2datetime(timeStr, now=None, monthBeforeDay=True):timeStr - The text to convert to a datetime.datetime objectnow - Defaults to now, but you can calculate relative to a different date if you provide a datetime.datetime heremonthBeforeDay - For relevant formats, True will have the expected format be month-before-day (American format), False will have day before month (European format).Other MethodsWhile text2datetime supports interpreting all known forms of date and time strings, there are individual public methods for each form you may also use.Seehttp://htmlpreview.github.io/?https://github.com/kata198/text2datetime/blob/master/doc/text2datetime.htmlfor pydoc of all methods.Supported FormatsDate should be in one of the following forms:Relative ModifiersRelative modifiers represent a delta from current time, current date.Each modifier starts with a direction (+ or -), then a number, then a unit.Example:  +3d  means ‘3 days from this very second’Available modifiers:y   = yearsyr  = yearsmo  = monthsd   = daysh   = hoursm   = minutess   = secondsYou may use relative modifiers and have a final entry be a fixed time,for example “+3d 12:00:00” would be noon three days from now.Fixed StringOne of the following fixed strings:“now”           - Right now (to the second)“today”         - Beginning of today (00:00:00)“tomorrow”      - Beginning of tomorrow“yesterday”     - Beginning of yesterdayCan optionally be followed with a time, as hour:minute or hour:minute:second, otherwise midnight (00:00:00) is used. Clock is 24-hour clock, 00=midnight, unless “PM” or “AM” is at the end.Example: “tomorrow 5:00PM”ctime formatCtime format with optional day of week(3-letter-day) [3-letter-month] [2-digit date] [2-hour]:[2-minute]:[2-second] [4-digit Year]Example: Wed Jan 28 12:28:13 2015American Date Formatnumeric Month/Day/Year with optional time as hour:minute or hour:minute:second. Clock is a 24-hour clock, 00=midnight, unless “PM” or “AM” is at the end.e.x.: 1/28/2015   or  1/28/2015  12:28:13This is used when monthBeforeDay=True (default) in text2datetime, getDatetimeFromDateStr when monthBeforeDay=True, and getDatetimeFromAmericanTimeEuropean Date Formatnumeric Day/Month/Year with optional time as hour:minute or hour:minute:second. Clock is a 24-hour clock, 00=midnight, unless “PM” or “AM” is at the end.e.x.: 28/1/2015   or  28/1/2015  12:28:13This is used when monthBeforeDay=False in text2datetime, getDatetimeFromDateStr when monthBeforeDay=False, and getDatetimeFromEuropeanTimeTime Onlytime as hour:minute or hour:minute:second will use current date. Clock is a 24 hour clock, 00=midnight, unless “PM” or “AM” is at the end.NOTES:Unless AM/PM is specified in formats that support it, hours are in 24-hour clock format, starting with 00=midnight, 23 = 11PM