Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In a database, I have the following date format that I can not convert to 'dd-mm-yyyy ".
example:
Last_udated_date |
---|
1382623150 |
1391500439 |
1391500540 |
1391500803 |
Who has an idea?
Best regards,
Arjan
Try
In QlikView script a possible implementation to convert from a Unix timestamp to the local time could be:
Timestamp = ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (<timestamp_field> / 86400)), '<time_zone>')
or
Timestamp = ConvertToLocalTime(Date(25569 + (<timestamp_field> / 86400)), '<time_zone>')
Hi
Can you say, which format is in database?
That looks like Unix Time Format (based on seconds since standard epoch of 1/1/1970)
1391500803 = Tue, 04 Feb 2014 08:00:03 GMT
Mysql database Mantis bugtraking
Van: Mayil Vahanan Ramasamy
Verzonden: dinsdag 4 februari 2014 11:22
Aan: Arjan IJlenhave
Onderwerp: Re: - Date settings
Qlik Community<http://community.qlik.com/>
Date settings
reply from Mayil Vahanan Ramasamy<http://community.qlik.com/people/MayilVahanan?et=watches.email.thread> in Scripting - View the full discussion<http://community.qlik.com/message/461463?et=watches.email.thread#461463>
It is the unix date format please convert like this :
QV Date = 25569 + <UnixDate> / 86400
Michael
Try
In QlikView script a possible implementation to convert from a Unix timestamp to the local time could be:
Timestamp = ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (<timestamp_field> / 86400)), '<time_zone>')
or
Timestamp = ConvertToLocalTime(Date(25569 + (<timestamp_field> / 86400)), '<time_zone>')
A QV date should be around 40,000
since the calendar starts from 31DEC1899, 00:00:00
Fabrice