Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

Extract datetime as seperate date & time.

Hi Everyone

I have date & time numeric field ( i am assuming it is numeric because it is alligned right when i view it in list box)

2013-01-01 00:00:00

2013-01-01 01:00:00

2013-01-01 02:00:00

2013-01-01 03:00:00

I am trying to extract date & time. Date is working fine, however time stamp is comming out incorrectly. below is what i am using.

date(floor(datefiled),'YYYY-MM-DD') as NewDate,

time(frac(datefield),'hh:mm:ss') as NewTime,

NewTime extracted shows up like this for above 4 field.

datefield                              NewTime

2013-01-01 00:00:00          08:00:00

2013-01-01 01:00:00          07:00:00

2013-01-01 02:00:00          17:00:00

2013-01-01 03:00:00          18:00:00

Why do my time extract incorrectly?

5 Replies
rustyfishbones
Master II
Master II

What about just

time.png

userid128223
Creator
Creator
Author

using Time only function gives me this

2013-01-01 00:00:00          17:00:00

2013-01-01 01:00:00          18:00:00

2013-01-01 02:00:00          19:00:00

2013-01-01 03:00:00          20:00:00

shree909
Partner - Specialist II
Partner - Specialist II

Hi  try like this

=subfield('2013-01-01 01:00:00 ',' ',2)    result   01:00:00

=subfield(Date,' ',2)   AS New_Time


rustyfishbones
Master II
Master II

Add the date field in a list box and choose number format as timestamp

Let me know what result that gives you

You should see 00:00:00

MayilVahanan

HI

Try  like this

Test:

Load Time(Date) as Time,*;

LOAD Date(Date#(DateTime,'YYYY-MM-DD hh:mm:ss'),'YYYY-MM-DD hh:mm:ss') AS Date;

Load * Inline

[

DateTime

2013-01-01 00:00:00

2013-01-01 01:00:00

2013-01-01 02:00:00

2013-01-01 03:00:00

];

Hope it helps

PFA

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.