//parses some string into that format.
datetime1 = datetime.strptime(somestring, "%Y-%m-%dT%H:%M:%S")
//gets the seconds from the above date.
timestamp1 = time.mktime(datetime1.timetuple())
//adds milliseconds to the above seconds.
timeInMillis = int(timestamp1) * 1000
(そのコードの任意の時点で) 日付を UTC 形式に変換するにはどうすればよいですか? 私は API を 1 世紀にもわたって調べてきましたが、機能するものを見つけることができません。誰でも助けることができますか?現在、私が信じている東部時間に変えています(ただし、私はGMTにいますが、UTCが必要です)。
編集:最終的に見つけたものに最も近い人に答えました。
datetime1 = datetime.strptime(somestring, someformat)
timeInSeconds = calendar.timegm(datetime1.utctimetuple())
timeInMillis = timeInSeconds * 1000
:)