用于日期操作的Python模块

Joh*_*ohn 1 python r date

是否有专门用于日期操作的python模块.相当于R中的lubridate包的东西.

Ram*_*ngh 9

Python有一个用于处理日期时间的内置模块..你可以试试.. !!

但是如果想要扩展一些东西(比如想要构建一个通用的日期时间解析器),请使用python-dateutil

from dateutil.parser import parse
datetimeObj = parse(strDate) 
# str date is a date string
Run Code Online (Sandbox Code Playgroud)