def toUnixSeconds(timestruct):
"""Convert a datetime struct to a Unix timestamp in seconds.
:type timestruct: :any:`datetime.datetime`
:param timestruct: A ``datetime`` object to convert into a timestamp in
Unix Era seconds.
:rtype: int
"""
return calendar.timegm(timestruct)
评论列表
文章目录