What is the easiest way to convert current local time and date in format YYYY-MM-DD hh:mm:ss
to UTC format in time
package of Python
? I'm using the following to obtain current time:
import time
time.strftime("%Y") + "-" + time.strftime("%m") + "-" + time.strftime("%d") + " " + time.strftime("%H") + ":" + time.strftime("%M") + ":" + time.strftime("%S")