Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
haymarketpaul
Creator III
Creator III

Time from Datetime

QV12 SR3

I have the following Datetime field

MyDatetimeDateTime
10/01/2011  12:02:0710/01/201112:02

I want to extract the Date and Time from it but i only want the hh:mm part of the time (like above)

I can get the date with this...

Date(Floor(MyDatetime))

i thought this might help me get the time portion i need but i'm missing something somewhere...

Time(Time#(Frac(MyDatetime),'hh:mm:ss'),'hh:mm')

1 Solution

Accepted Solutions
sdmech81
Specialist
Specialist

use like this:

=Timestamp(MyDatetime,'hh:mm')

View solution in original post

7 Replies
sdmech81
Specialist
Specialist

check with :

=Timestamp(MyDatetime)

surendraj
Specialist
Specialist

date(date#('10/01/2011 12:02:07','DD/MM/YYYY hh:mm:ss'),'DD-MM-YYYY') as Date,

Timestamp(date#('10/01/2011 12:02:07','DD/MM/YYYY hh:mm:ss'),'hh:mm')  as Time

sunny_talwar

May be this:

Time(Round(Frac(MyDateTime), (1/24*60))) as Time

or

Time(Floor(Frac(MyDateTime), (1/24*60))) as Time

sdmech81
Specialist
Specialist

use like this:

=Timestamp(MyDatetime,'hh:mm')

sdmech81
Specialist
Specialist

Only this much should work bcs your MyDatetimeis proper format I guess

Thanks

haymarketpaul
Creator III
Creator III
Author

Thanks all

Timestamp(MyDatetime,'hh:mm')   works nicely


the others didn't seem to quite work but interesting

sdmech81
Specialist
Specialist

The simple wat to check wthr u can go ahead and use Date and time functions bfr jumping into string fns,any function on dates is to add the date column in to list box then check if the values r falling on right side of list box then Qlik has taken it as date,if values fall on left side of list box then Qlik didn't.

Plss check HIC docs on date.Thanks