Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
How to fetch hours in 12 and 24 formats?
=TimeStamp(now(), 'MM/DD/YYYY hh:mm:ss')
Time format for 12 horus is 'h:mm:ss' and you need the 'hh:mm:ss' format, so drop one h from Timestamp# function:
Timestamp(Timestamp#(MyTimeStampFieldin12HrsFormat,'h:mm:ss TT') ,'hh:mm:ss') as MyTimeStampFieldin24HrsFormat
I have modified my question.could you please help me in that if you might know
Thank you Rama Sai,
But I am not getting expected results.
You want a different field to get your hours ? You can try like
LOAD
IF(hour(Timestamp(MyHour)) < 12, 'AM',
IF(hour(Timestamp(MyHour)) >= 12 AND hour(Timestamp(MyHour)) <= 24, 'PM')) AS [AM PM];
LOAD
timestamp(floor(YourdateField) + Maketime(hour(Yourdatefield)), 'hh') as MyHour,
......
FROM yoursource;