python3 datetime.timestamp in python2?

前端 未结 2 1133
余生分开走
余生分开走 2021-01-17 11:30

I have a piece of python3 code, that calls a function at 22:00.

# Imports
from datetime import datetime, date, time, timedelta
import sched         


        
2条回答
  •  甜味超标
    2021-01-17 11:58

    use the following to convert to a timestamp in python 2

    int((mod_time.mktime(first_run.timetuple())+first_run.microsecond/1000000.0))

提交回复
热议问题