1

I was trying to upload some DATETIME data with DolphinDB Python API. I tried the following code.

from datetime import datetime
import dolphindb as ddb

sess = ddb.session('localhost', 8848)
sess.upload({'t': datetime(2020, 2, 2)})

But I got the following exception.

Traceback (most recent call last):

File "", line 1, in

File "/home/ynwang/.local/lib/python3.6/site-packages/dolphindb/session.py", line 64, in upload

return self.cpp.upload(nameObjectDict)

RuntimeError: unrecognized Python type:

So how do I correctly upload the datetime data?

Clyx
  • 43
  • 7

1 Answers1

1

I believe DolphinDB Python API only supports numpy.datetime64. Try the following script:

sess.upload({'t':np.datetime64(datetime(2020,2,2))})
Bob
  • 137
  • 2
  • 9