Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
'hh:mm:ss'--->24 hrs Format
hh:mm:ss TT-->12 hrs Format
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]';
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')))
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;
Here you go,
Timestamp(Timestamp#(now(),'MM/DD/YYYY hh:mm:ss TT'),'MM/DD/YYYY hh:mm:ss')
Thanks,
Prabhu