cancel
Showing results for 
Search instead for 
Did you mean: 

modulo date

maximillian_mur
New Contributor
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
2 REPLIES 2

kuentang
New Contributor

 

Multiplication is not defined for time.

 

Here is a workaround:

`second$(mod).`long$40:59:00 24:00:00

 

Kim

 

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

 

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

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at https://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.

charlie
New Contributor II
New Contributor II
q)40:59:00 mod 86400
16:59:00