Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date stamp conversion

Hi, I'm battling to convert this raw data into a normal date.

here is an example of the date stamp (CreatedDate field) import:  "2015-06-11T09:45"

I want to convert this to just the normal date like this:  "2015/06/11".

Please assist with syntax for this.

Many thanks

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Date(Date#(Left(CreatedDate, 10), 'YYYY-MM-DD'), 'YYYY/MM/DD') as Date

View solution in original post

8 Replies
sunny_talwar

Try this:

Date(Date#(Left(CreatedDate, 10), 'YYYY-MM-DD'), 'YYYY/MM/DD') as Date

Not applicable
Author

Perfect!  Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

You can also try like this

LOAD

*,

MakeDate(SubField(CreatedDate, '-', 1), SubField(CreatedDate, '-', 2), SubField(CreatedDate, '-', 3)) AS Date

FROM DataSource;

Hope this helps you.

Regards,

jagan.

HirisH_V7
Master
Master

Hi,

Check this,

Replace(SubField(Field,'T',1),'-','/')

HTH,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
senpradip007
Specialist III
Specialist III

Try like:

date(Timestamp#(replace(CreateDate, 'T', ' '), 'YYYY-MM-DD hh:mm'), 'YYYY/MM/DD') as NewDate

tamilarasu
Champion
Champion

Also try,

Date(Date#(PurgeChar(CreatedDate,'T'),'YYYY-MM-DDhh:ss'),'YYYY/MM/DD')

                                                  OR

Date(Date#(Replace(CreatedDate,'T',''),'YYYY-MM-DDhh:ss'),'YYYY/MM/DD')

engishfaque
Specialist III
Specialist III

Dear Manus,

Here is a script for timestamp conversion

Table1:

LOAD *, Date(Left(Date, Index(Date, 'T') - 1), 'YYYY/MM/DD') as newDateField Inline [

  Date

  2015-06-11T09:45

];

For more detail, kindly find attached App.

Kind regards,

Ishfaque Ahmed

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer and optionally Helpful Answers.

If not, please make clear what part of your question you still need help with .

May you live in interesting times!