Hello,
Given that kdb dates are numeric, I am curious why the following _should_ not work. I expected it to return 16:59:00. That it doesn’t work is relatively uninteresting as it could simply be an incomplete implementation.
q)40:59:00 mod 24:00:00
k){x-y*x div y}
'type
*
24:00:00
00:00:01
q.q))
Best wishes, Max
<o:p> </o:p>
Multiplication is not defined for time.<o:p></o:p>
<o:p> </o:p>
Here is a workaround:<o:p></o:p>
second$(mod).
long$40:59:00 24:00:00<o:p></o:p>
<o:p> </o:p>
Kim<o:p></o:p>
<o:p> </o:p>
Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von M Murphy
Gesendet: Dienstag, 12. Januar 2016 22:42
An: Kdb+ Personal Developers
Betreff: [personal kdb+] modulo date<o:p></o:p>
<o:p> </o:p>
Hello,<o:p></o:p>
<o:p> </o:p>
Given that kdb dates are numeric, I am curious why the following _should_ not work. I expected it to return 16:59:00. That it doesn’t work is relatively uninteresting as it could simply be an incomplete implementation.<o:p></o:p>
<o:p> </o:p>
q)40:59:00 mod 24:00:00<o:p></o:p>
k){x-y*x div y}<o:p></o:p>
'type<o:p></o:p>
*<o:p></o:p>
24:00:00<o:p></o:p>
00:00:01<o:p></o:p>
q.q))<o:p></o:p>
<o:p> </o:p>
Best wishes, Max<o:p></o:p>
–
Submitted via Google Groups