Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

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

mm is minutes

MM is Month

View solution in original post

12 Replies
sunny_talwar

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

sunny_talwar

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

Not applicable
Author

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,

Not applicable
Author

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

sunny_talwar

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

sunny_talwar

Try this:

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

Not applicable
Author

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

antoniotiman
Master III
Master III

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

mm is minutes

MM is Month

Not applicable
Author

yup, still no difference in the result