Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert TimeStamp format

Hello community,

how can I convert this TimeStamp format: '20141029122728' to this one: TimestampFormat='DD.MM.YYYY hh:mm:ss';

Thank you,

Thorsten

1 Solution

Accepted Solutions
Colin-Albert

It would be better to split your timestamp filed into two separate date and time fields as this will use less memory in the app.

date(date#( '20141029122728' , 'YYYYMMDDhhmmss'), 'DD.MM.YYYY')  as date

time(date#( '20141029122728' , 'YYYYMMDDhhmmss'), hh:mm:ss) as time

Also if you do not need the data in seconds, then just storing the time as hh.mm will further reduce the overhead.

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi

Try this

Date(Timestamp(Today()),'DD/MM/YYYY hh:mm:ss')


Instead of Today() use your dateformatte field

jyothish8807
Master II
Master II

Hi Thorsten,

Try this:

Timestamp(Timestamp#(Yourfield,'YYYYMMDDhhmmss'),'DD.MM.YYYY hh:mm:ss') as NewTime

Regards

KC

Best Regards,
KC
Colin-Albert

This will convert your date

date(date#( '20141029122728' , 'YYYYMMDDhhmmss'), 'DD.MM.YYYY hh:mm:ss')

date(date#(YourDateField, 'YYYYMMDDhhmmss'), 'DD.MM.YYYY hh:mm:ss')

lironbaram
Partner - Master III
Partner - Master III

hi,

here is a script for doing the conversion,

please note i assume that month and day will be given with two digits allways

load *,

  Timestamp(MakeDate(left(Original,4),mid(Original,5,2),mid(Original,7,2))+mid(Original,9,2)/24+mid(Original,11,2)/1440+mid(Original,13,2)/86400,'DD.MM.YYYY hh:mm:ss') AS Calculated;

LOAD * INLINE [

    Original

    20141029122728

];

Colin-Albert

It would be better to split your timestamp filed into two separate date and time fields as this will use less memory in the app.

date(date#( '20141029122728' , 'YYYYMMDDhhmmss'), 'DD.MM.YYYY')  as date

time(date#( '20141029122728' , 'YYYYMMDDhhmmss'), hh:mm:ss) as time

Also if you do not need the data in seconds, then just storing the time as hh.mm will further reduce the overhead.

Not applicable
Author

Thank you all for showing various options.