Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Timestamp to Date format, but not working.

Hi,

I have a super simple problem, but a problem nonetheless.

I have a field called newDate which I had converted from Timestamp format into Date format.

floor(oldDate) as newDate

But, tadaaaa, it gave me numbers instead: 41408.

I need to display the date in my textbox. I used the following expression but it doesnt work.

=date(date#(newDate, 'M/DD/YYYY'), 'DD/M/YYYY')

initially the format was in timestamp, like this: 5/14/2013 12:00:00 AM

any idea how to convert those numbers back to date format?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can create the field like this in the script to give it a date format: date(floor(oldDate),'DD/MM/YYYY') as newDate

Or if you want to format it in an expression: date(newDate,'DD/MM/YYYY')

Or if you want to format it in a listbox, click on the Number tab, choose Date and enter DD/MM/YYYY as format string


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
narender123
Specialist
Specialist

Hi,

I think you need to do it as

=date(date#(newDate, 'MM/DD/YYYY'), 'DD/MM/YYYY')

OR IN SCRIPT LEVEL  MAKE FILED AS

Date(yourdatefiled,'DD/MM/YYYY')

Thanks

Gysbert_Wassenaar

You can create the field like this in the script to give it a date format: date(floor(oldDate),'DD/MM/YYYY') as newDate

Or if you want to format it in an expression: date(newDate,'DD/MM/YYYY')

Or if you want to format it in a listbox, click on the Number tab, choose Date and enter DD/MM/YYYY as format string


talk is cheap, supply exceeds demand
Not applicable
Author

thank you all, it works perfectly!

Not applicable
Author

That was so helpfull!

Thanks!