Is there an inverse function for time.gmtime() that parses a UTC tuple to seconds since the epoch?

后端 未结 4 1183
抹茶落季
抹茶落季 2020-12-14 17:33

python\'s time module seems a little haphazard. For example, here is a list of methods in there, from the docstring:

time() -- return current time in second         


        
4条回答
  •  甜味超标
    2020-12-14 17:55

    There is actually an inverse function, but for some bizarre reason, it's in the calendar module: calendar.timegm(). I listed the functions in this answer.

提交回复
热议问题