本文介绍了如何在几毫秒内在Python中创建datetime?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以通过在Java中创建类似的Date对象java.util.Date(milliseconds)。如何在Python中创建可比较的数据?
I can create a similar Date object in Java by java.util.Date(milliseconds). How do I create the comparable in Python?
分配一个Date对象,并将其初始化为表示从标准基准时间开始的指定的毫秒数被称为时代,即1970年1月1日,00:00:00 GMT。
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.
推荐答案
只需将其转换为时间戳
datetime.datetime.fromtimestamp(ms/1000.0)更多推荐
如何在几毫秒内在Python中创建datetime?
发布评论