Javascript Bokeh如何存储日期时间信息

Javascript Bokeh如何存储日期时间信息,javascript,python,datetime,bokeh,epoch,Javascript,Python,Datetime,Bokeh,Epoch,我正在使用Javascript回调将存储在bokehsource对象中的数据写入csv 当我访问datetime列时,会得到一种奇怪的格式。 条目2017-03-16T00:00:00.000000000的日期表示形式将变为938736000000,该格式似乎不正确 如何从数字表示中检索可读的日期时间表示?您得到的值可能是微秒格式的时间戳。没有任何源代码就很难诊断问题,但您可以尝试以下方法: from bokeh.models import DatetimeTickFormatter from

我正在使用Javascript回调将存储在bokeh
source
对象中的数据写入csv

当我访问datetime列时,会得到一种奇怪的格式。 条目
2017-03-16T00:00:00.000000000
的日期表示形式将变为
938736000000
,该格式似乎不正确


如何从数字表示中检索可读的日期时间表示?

您得到的值可能是微秒格式的时间戳。没有任何源代码就很难诊断问题,但您可以尝试以下方法:

from bokeh.models import DatetimeTickFormatter
from bokeh.plotting import figure
然后将其用于格式化:

p = figure(plot_width=400, plot_height=400)
p.xaxis.formatter=DatetimeTickFormatter(
    hours=["%d %B %Y"],
    days=["%d %B %Y"],
    months=["%d %B %Y"],
    years=["%d %B %Y"],
)
show(p)

您得到的值可能是微秒格式的时间戳。没有任何源代码就很难诊断问题,但您可以尝试以下方法:

from bokeh.models import DatetimeTickFormatter
from bokeh.plotting import figure
然后将其用于格式化:

p = figure(plot_width=400, plot_height=400)
p.xaxis.formatter=DatetimeTickFormatter(
    hours=["%d %B %Y"],
    days=["%d %B %Y"],
    months=["%d %B %Y"],
    years=["%d %B %Y"],
)
show(p)
它不是微秒,它是从epochIt开始的毫秒,它不是微秒,它是从epochIt开始的毫秒