What is the difference between Python functions datetime.now() and datetime.today()?
函数datetime.now()使用tzinfo作为关键字参数,但datetime.today()不使用任何关键字参数。 引用文档:
datetime.now()返回当前本地日期和时间。 如果可选参数tz为None或未指定,则类似于today(),但是,如果可能,提供的精度比通过time.time()时间戳获得的精度更高(例如,在提供 C gettimeofday()函数)。