time + date = datetime

1,035 views
Skip to first unread message

kuentang

unread,
Apr 1, 2011, 11:55:41 AM4/1/11
to Kdb+ Personal Developers

Hi all,

i tried to add time to date, but it fails.

What is the most efficient way to do it correctly? I believe that i
need to cast it, but to what type ?

String, int,float, symbol are all not working.


d:2011.08.12;
m:09:00:00;

d+m is not working.


Thanks for any help.

Kim

Niraj Koradia

unread,
Apr 1, 2011, 11:57:22 AM4/1/11
to personal...@googlegroups.com
datetime format has a T between date and time try doing this
2011.08.12T09:00:00


--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To post to this group, send email to personal...@googlegroups.com.
To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.




--
If u dont lead, ull do just a mere head count!!!

Aaron Davies

unread,
Apr 1, 2011, 12:17:28 PM4/1/11
to personal...@googlegroups.com
works for me. paste your error

$ q
KDB+ 2.6 2011.02.04 Copyright (C) 1993-2011 Kx Systems
l64/

q)d:2011.08.12
q)m:09:00:00
q)d+m
2011.08.12T09:00:00.000

fintanq

unread,
Apr 1, 2011, 12:20:00 PM4/1/11
to Kdb+ Personal Developers
Hello,

This works for me in the version I'm using. Not that m is of type
second ("v") & not time ("t"). Perhaps this may be causing the issue
in the version you're using.

q)d:2011.08.12
q)m:09:00:00
q)d+m
2011.08.12T09:00:00.000
q).z.k
2011.03.07
q).z.K
2.7

Regards,

Fintan.

fintanq

unread,
Apr 1, 2011, 12:20:08 PM4/1/11
to Kdb+ Personal Developers
Hello,

This works for me in the version I'm using. Not that m is of type
second ("v") & not time ("t"). Perhaps this may be causing the issue
in the version you're using.

q)d:2011.08.12
q)m:09:00:00
q)d+m
2011.08.12T09:00:00.000
q).z.k
2011.03.07
q).z.K
2.7

Regards,

Fintan.

On Apr 1, 11:55 am, kuentang <kuent...@vodafone.de> wrote:

kuentang

unread,
Apr 1, 2011, 12:45:22 PM4/1/11
to Kdb+ Personal Developers
Thanks for all the reply so far.

This is roughly the Code that creates the Error
{select d +m from x} select by d,1 xbar t.minute from ([] t:.z.t+til
10; d:.z.d+Til 10)

and it Works on my Personal machine but Not on that from the work.
I believed As indicated by finqtang this is a Minute and Date issue.

Thanks for all the comments
Reply all
Reply to author
Forward
0 new messages