Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

date format issue

Hi,

I have some dates in an xml file which are in the format d.m.yyyy hh:mm:ss. An example date is 1.6.2015 21:13:54. Now I want to show this date in the default format of my Qlikview document so that I have converted them like this in the Qlikview script

Date#(StartedAt,'dd.mm.yyyy hh:mm:ss') as testdate1,

date(Date#(StartedAt,'dd.mm.yyyy hh:mm:ss')) as testdate2,

This first one is without casting to date, and the second one is to cast it into local document format. However, when I check the document, they don't seem to be converted correctly. For example, please see the attached image

Can someone please tell me how to correct covert them into local document date format

Regards

Shah

Tags (1)
1 Solution

Accepted Solutions
Highlighted
antoniotiman
Honored Contributor III

Re: date format issue

try' DD.MM.YYYY hh:mm:ss'

mm is minutes

MM is Month

View solution in original post

12 Replies
Highlighted

Re: date format issue

Try this:

Date(Date#(Trim(StartedAt), 'dd.mm.yyyy hh:mm:ss')) as testdate3,

Date(Floor(Date#(Trim(StartedAt), 'dd.mm.yyyy hh:mm:ss'))) as testdate4

Highlighted

Re: date format issue

Here testdate3 will be still have the timestamp, but will only show Date. And testdate4 will only be Date (time floored to 0).

HTH

Best,

Sunny

Highlighted
Not applicable

Re: date format issue

already tried this

Date#(trim(StartedAt),'dd.mm.yyyy hh:mm:ss') as testdate1,

date(Date#(trim(StartedAt),'dd.mm.yyyy h:m:s')) as testdate2,

Highlighted
Not applicable

Re: date format issue

The problem is that I need to convert them to default document timestamp without flooring the time part as I need it in timestamp format of the document default

Highlighted

Re: date format issue

What I suggested is different

Your:

Date#(trim(StartedAt),'dd.mm.yyyy hh:mm:ss') as testdate1, 

date(Date#(trim(StartedAt),'dd.mm.yyyy h:m:s')) as testdate2,


vs. Mine:

Date(Date#(Trim(StartedAt), 'dd.mm.yyyy hh:mm:ss')) as testdate3,

Date(Floor(Date#(Trim(StartedAt), 'dd.mm.yyyy hh:mm:ss'))) as testdate4

Highlighted

Re: date format issue

Try this:

TimeStamp(TimeStamp#(Trim(StartedAt), 'dd.mm.yyyy hh:mm:ss')) as testdate5,

Highlighted
Not applicable

Re: date format issue

In any case, it is still returning the same result even after flooring the time part as you suggested. I already tried trimming the string

Highlighted
antoniotiman
Honored Contributor III

Re: date format issue

try' DD.MM.YYYY hh:mm:ss'

mm is minutes

MM is Month

View solution in original post

Highlighted
Not applicable

Re: date format issue

yup, still no difference in the result