Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ankit777
Specialist
Specialist

Timestamp

Hi All,

In QlikView Script I am generating time in a field using the following function:

 

timestamp(now(),'DD-MMM-YY hh:mm:ss')

But the time I am getting is 12 Hour format. I want the time in 24 hour format.

What changes should I make to the above function?

5 Replies
anbu1984
Master III
Master III

'hh:mm:ss'--->24 hrs Format

hh:mm:ss TT-->12 hrs Format

tresesco
MVP
MVP

By default it gives 24-hour format output. Or if you are getting AM/PM in the front end, you have to SET the format in the script like:

SET TimestampFormat='DD-MM-YYYY hh:mm:ss[.fff]';

MK_QSL
MVP
MVP

Try below to get Date and Time from TimeStamp

Time

=TIME(Frac(Timestamp#(NOW(),'DD-MMM-YY hh:mm:ssTT')),'hh:mm:ss')

Date

=Date(Floor(Timestamp#(NOW(),'DD-MMM-YY hh:mm:ssTT')))

nizamsha
Specialist II
Specialist II

TableA:

LOAD * Inline [

Date

1-04-2014 15:15

2-05-2014 11:20

];

LOAD  Date( Date#(Date,'DD-MM-YYYY h:mm'),'DD-MM-YYYY h:mm TT') as N1 Resident TableA;

Not applicable

Here you go,

Timestamp(Timestamp#(now(),'MM/DD/YYYY hh:mm:ss TT'),'MM/DD/YYYY hh:mm:ss')

Thanks,

Prabhu