Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
praveenkumar_s
Creator II
Creator II

Time conversion

Hi,

I have a date in excel in the format '2/21/2016 4:00:00 AM' when i load the script i didnt get the correct date format and also i want only the date and removing time from the above foramt. How can it be done? I hope somebody helps...

5 Replies
asgardd2
Creator III
Creator III

Hello!

date(timestamp#('2/21/2016 4:00:00 AM','M/D/YYYY h:mm:ss tt'))

Not applicable

Hi Praveen,

When you load any date fields into qlikview, It will be stored as number internally, You need to convert it into your flexible date format.

You can use this expression

=Date(Field,'DD-MM-YYYY') or You can set format in Number tab as below

Capture.PNG

--Ashok

avinashelite

if you want only the date try like this

date(Floor(field_name) ,'DD-MM-YYYY') as field_name_New

surendraj
Specialist
Specialist

Hi praveen kumar,

if you want customised date format try this one.

if you want to make your standard format into this DD-MM-YYYY

then try below expression in script:

date(timestamp#('2/21/2016 4:00:00 AM','M/D/YYYY h:mm:ss tt'),'DD-MM-YYYY' ) as new_date

--surendra

ishanbhatt
Creator II
Creator II

Hi Praveen,

Use below statement in your script.

Date(Floor(Num(Date_Field))) AS Date_Field.

You can use Floor or Ceil as per your requirement.

Ishan