Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Date format Help!

Hi Folks,

Below is my source date format

Tue May 24 06:43:44 BST 2016

Tue May 24 06:50:17 BST 2016

How can I convert this to 'DD-MM-YY HH;MM:SS ' format ????

Thanks,

AS

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Date(Date#(Mid(DateField,5,6) & ' ' & Right(DateField,4) & ' ' & Mid(DateField,12,8),'MMM DD YYYY hh:mm:ss'),'DD-MM-YY hh:mm:ss') as YourNewDateField

or

Front End

=Date(Date#(Mid(DateField,5,6) & ' ' & Right(DateField,4) & ' ' & Mid(DateField,12,8),'MMM DD YYYY hh:mm:ss'),'DD-MM-YY hh:mm:ss')

View solution in original post

7 Replies
Chanty4u
MVP
MVP

try

Date(date#(Daefield,'Tue May 24 06:43:44 BST 2016'), 'DD-MM-YY HH;MM:SS) as newdate

migueldelval
Specialist
Specialist

Hi Amit,

If for example your date field it´s called "DATE".

date#(DATE, 'DD-MM-YY HH;MM:SS ') as Date_2,

Tri it and tell me if it´s ok

Regards

Miguel del Valle

PrashantSangle

Hi,

try like

=date(date#(mid(Replace('Tue May 24 06:43:44 BST 2016','BST',''),5),'MMM DD hh:mm:ss  YYYY'),'MM/DD/YYYY')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MK_QSL
MVP
MVP

Date(Date#(Mid(DateField,5,6) & ' ' & Right(DateField,4) & ' ' & Mid(DateField,12,8),'MMM DD YYYY hh:mm:ss'),'DD-MM-YY hh:mm:ss') as YourNewDateField

or

Front End

=Date(Date#(Mid(DateField,5,6) & ' ' & Right(DateField,4) & ' ' & Mid(DateField,12,8),'MMM DD YYYY hh:mm:ss'),'DD-MM-YY hh:mm:ss')

PrashantSangle

Hi,

update date format as per requirement.

I have set MM/DD/YYYY you can replace it with your required format DD-MM-YY HH;mm:SS

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MK_QSL
MVP
MVP

Replace

Date# with TimeStamp# and

Date with TimeStamp

in my above expressions...

mikael_bjaveclo
Partner - Contributor II
Partner - Contributor II

I'm Swedish and I would maybe have presented the timestamps in my local time, and with my local settings (

SET TimestampFormat='YYYY-MM-DD hh:mm:ss[.fff]'; ).

This is the way of doing it.

Load *,
ConvertToLocalTime(BrittishTimeStamp, 'London', 0) As LocalTimeStamp;
LOAD *,
TimeStamp(TimeStamp#(Mid(Date, 5, 6) & ' ' & Right(Date, 4) & ' ' & Mid(Date, 12, 8), 'MMM DD YYYY hh:mm:ss'), '$(TimestampFormat)') As BrittishTimeStamp
FROM...