如何在 Python 中以毫秒爲單位創建日期時間? - How do I create a datetime in Python from milliseconds?

問題:

I can create a similar Date object in Java by java.util.Date(milliseconds) .我可以通過java.util.Date(milliseconds)在 Java創建一個類似的 Date 對象。 How do I create the comparable in Python?如何在 Python 中創建可比對象?

Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.分配一個 Date 對象並將其初始化以表示自稱爲“紀元”的標準基準時間(即格林威治標準時間 1970 年 1 月 1 日 00:00:00)以來的指定毫秒數。


解決方案:

參考一: https://en.stackoom.com/question/38iR
參考二: https://stackoom.com/question/38iR
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章