Hi, Dear all:
I have a bunch of timestamp data. I need to pass them from python to kdb+. But I’m confused why the data conversion does not match each other.
For example, the value of timestamp data is 12477000, the conversion in kdb+ is right, such as:
q)`time$12477000
03:27:57.000
But the conversion in python(I use numpy and time to do the work) is not right:
In time module, the output of time.strftime is:
time.struct_time(tm_year=1970, tm_mon=5, tm_mday=25, tm_hour=09, tm_min=50, tm_sec=0, tm_wday=0, tm_yday=145, tm_isdst=0)
So, the key is how to let it know just hour:min:sec is required, year-month-day can be discarded.
From:personal-kdbplus@googlegroups.com <personal-kdbplus@googlegroups.com> on behalf of hzadonis@gmail.com <hzadonis@gmail.com> Sent: 04 June 2018 10:15:44 To: Kdb+ Personal Developers Subject: [personal kdb+] Re: What’s the difference between `time& and numpy to convert a timestamp
Yes, you’re right. I noticed it. But how can I let python time.gmtime convert since midnight or other cheat/magic method?