Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 dateparser python 的模块来解析日期。我怎样才能让 dateparser 不是从当前日期和时间开始计算,而是从我设置的日期开始计算,比如today = datetime(2021, 1, 1)?
today = datetime(2021, 1, 1)
RELATIVE_BASE在设置中使用。
RELATIVE_BASE
例如:
parse('tomorrow', settings={'RELATIVE_BASE': datetime.datetime(2020, 1, 1)})