We can use the time module in Python Mktime method will be converted to UNIX timestamp, mktime function can only accept the corresponding time Ganso sequence. Before you do this, you need to convert the input time to a tuple sequence:
If the input time is in the specified format, you can use the Strptime () function to parse a time string into a time tuple based on the specified format.
Time. Strptime(string[, format])
Example: Time.strptime (' 2017-11-18 13:37:09 ', '%y-%m-%d%h:%m:%s ')
If you enter a datetime.datetime (2017, 9, 14, 15, 23, 41) format, you can convert it to a time tuple using the Timetuple () method.
Dtime = Datetime.datetime.now ()
Dtime.timetuple ()
After converting to a time-tuple sequence, you can then convert it with the Mktime function: Time.mktime (timetuple)
"Original" uses Python to summarize the time UNIX format conversion