exxeleron / qPython

interprocess communication between Python and kdb+
http://www.devnet.de
Apache License 2.0
152 stars 89 forks source link

QTemporal wrong time #39

Open tfangz888 opened 8 years ago

tfangz888 commented 8 years ago

I found time wrong in example console.py

In q: q).z.z 2016.06.15T# 22:49:42.868 q).z.Z 2016.06.16T_# 10:49:47.925 q)

in qpython: Q).z.z

2016-06-16T# 06:50:16.811+0800 [metadata(qtype=-15)] Q).z.Z

2016-06-16T_# 18:50:21.444+0800 [metadata(qtype=-15)]

slawomirpanic commented 8 years ago

I wouldn't say that it is an error, returned dates are the same but printed with taking into account your time zone. Date is shifted for 8 hour and this information is included in represented string:

Q).z.z 2016-06-16T06:50:16.811+0800 [metadata(qtype=-15)]

Starting from version 1.11.0 of the numPy library that is used in qPython the logic of handling datetime64 type has changed and is timezone naive now. If you want to get same representation as in q without timezone adjustment you should upgrade numPy version.