dateparser

How to determine whether dateparser.search.search_dates() returns dates, times, or datetimes

≡放荡痞女 提交于 2020-03-02 19:14:12
问题 Trying to answer another question I stumbled over the following problem: dateparser.search.search_dates() returns a list of tuples, each tuple consisting of a text segment recognized as carrying date and/or time information, and the corresponding datetime (plus an optional language code, if requested). If the segment was of date type, only the date fields of the datetime are set. The others are taken from the current time, or from a base datetime that can be supplied via the settings