Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
wuming79
Creator
Creator

How do I convert a text timestamp to another field during data loading?

Hi,

I have a field that is in the following format. 

YYYY-MM-DD HH:MM:SS

Is it possible to load this field to the following format. 

YYYY/MM/DD HH:MM:SS AM or YYYY/MM/DD HH:MM:SS PM

 

Labels (1)
2 Solutions

Accepted Solutions
seangordonsa
Partner - Contributor II
Partner - Contributor II

Hi

You can use the "timestamp#" function and then format the time as you need.

timestamp(timestamp#(DateField,'YYYY-MM-DD HH:mm:ss'),'YYYY/MM/DD hh:mm:ss tt')

Please give this a try.

Regards,

View solution in original post

jonathandienst
Partner - Champion III
Partner - Champion III

This should do it:

Date(Date#(myDateField, 'YYYY-MM-DD hh:mm:ss'), 'YYYY-MM-DD hh:mm:ss tt')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
seangordonsa
Partner - Contributor II
Partner - Contributor II

Hi

You can use the "timestamp#" function and then format the time as you need.

timestamp(timestamp#(DateField,'YYYY-MM-DD HH:mm:ss'),'YYYY/MM/DD hh:mm:ss tt')

Please give this a try.

Regards,

jonathandienst
Partner - Champion III
Partner - Champion III

This should do it:

Date(Date#(myDateField, 'YYYY-MM-DD hh:mm:ss'), 'YYYY-MM-DD hh:mm:ss tt')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
wuming79
Creator
Creator
Author

Thanks Guys, Date(Date#(myDateField, 'YYYY-MM-DD hh:mm:ss'), 'YYYY/MM/DD hh:mm:ss tt') did the job!