Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

arjanijlenhave
New Contributor II

Date settings

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

1 Solution

Accepted Solutions
Partner
Partner

Re: Date settings

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>')

View solution in original post

6 Replies

Re: Date settings

Hi

Can you say, which format is in database?

Partner
Partner

Re: Date settings

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

arjanijlenhave
New Contributor II

Re: Date settings

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>

Partner
Partner

Re: Date settings

It is the unix date format please convert like this :

QV Date = 25569 + <UnixDate> / 86400

Michael

Partner
Partner

Re: Date settings

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>')

View solution in original post

Not applicable

Re: Date settings

A QV date should be around 40,000

since the calendar starts from 31DEC1899, 00:00:00

Fabrice