Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Integer to date

Hello,

I have a question regarding the changing of integer to date.

From the database I have integers, but I can not get the right date out of it.

I've read quite a few posts already, but none helped me solve my issue.

Two examples from my database and value in Qlikview:

1)

in database and wanted date in Qlikview: 08-02-2014 10:35:32

integer in Qlikview: 1391852132

2)

in database and wanted date in Qlikview: 01-07-2011 11:41:46

integer in Qlikview: 1309513306

I would like help or a blogpost to help me solve this issue.

I do not need the time, but I might be helpful to understand why the integer returns this value

Thank you in advance.

Kind regards,

Erwin

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

I think I found the answer in How to get date from integer format

I used         Date(MakeDate(1970,01,01) + MyDate / 24 / 60 / 60)    to solve it.

Looks like it's working

View solution in original post

4 Replies
Not applicable
Author

The difference between the two dates is 2 years, 7 months, 6 days, 22 hours and 54 minutes.

The difference (in integer) is 82.338.826

I calculated  2 years, 7 months, 6 days, 22 hours and 54 minutes in seconds and this is roughly 82.250.000

Can it be my database returns the date in seconds?

Not applicable
Author

I think I found the answer in How to get date from integer format

I used         Date(MakeDate(1970,01,01) + MyDate / 24 / 60 / 60)    to solve it.

Looks like it's working

maxgro
MVP
MVP

it seems your number is in seconds starting from 1970-01-01 (Unix epoch ?)

with this expression

= date((1391852132 / ( 60*60*24)) + Date#('01-01-1970', 'DD-MM-YYYY'), 'DD-MM-YYYY hh:mm:ss')

result is

08-02-2014 09:35:32

jonasheisterkam
Partner - Creator III
Partner - Creator III

It is the Unix Timestamp.

http://community.qlik.com/ideas/2517