Python time module总结

import time

一、时间戳转换成struct_time(tuple):

  gmtime:把时间戳转换成UTC时区struct_time

  

  localtime:把时间戳转换成当前所在地时区struct_time

  

二、struct_time转换成时间戳:

  mktime:把strut_time转换成时间戳

  

三、struct_time转换成格式化字符串时间:

  strftime:

  

四、格式化的字符串时间转换成struct_time:

  strptime:

  

猜你喜欢

转载自www.cnblogs.com/skyliao/p/9221713.html