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: 
Not applicable

Datetime to just time

Hi guys...

I need to extract just time from a field which is DateTimestamp.... But i can't think of anything... The format is as follows:

'DD/MM/YYYY hh:mm:ss'

i have tried

time(DATETIME) as TransTime

time(DATETIME, 'hh:mm') as TransTime

But neither are working. Any suggestions please?

Regards

4 Replies
Not applicable
Author

Hi,

What are the output of the two functions you are trying ?

You can use timestamp() function or maketime function.

if all the date-time values are having proper length at least for time part then maketime will work.

use maketime ( mid ( date, 12, 2 ), mid ( date, 16, 2 ), right ( date, 2 ) ) as time

Reg,

Shubhu

Not applicable
Author

Dear

try it

=time(date(DATETIME,'DD/MM/YYYY hh:mm:ss'),'hh:mm')

it should be work. and above function is also working.

I tried both functions are working properly.

Thanks and Regards

Not applicable
Author

Hi Blaze,

Try this...



TIME

(NOW(),'hh:mm:ss:TT')



Miguel_Angel_Baeyens

Hello,

First, get the right timestamp, then get the time part of it

=Time(TimeStamp#('08/03/2011 08:10:30', 'DD/MM/YYYY hh:mm:ss'))


Hope that helps.