Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with time stamp conversion

I am fetching data from db and storing the data in qvd . in this i am getting values of a date time field as number such as

1426807749 but when i am trying to convert this into time stamp .i am not getting the desired result when i am trying as below

MakeDate(Year(start_time),Month(start_time),Day(start_time)) as Outage_StartTime,        

timestamp(start_time) as start_time,

Please suggest how can we convert this into timestamp .

12 Replies
sunny_talwar

what date 1426807749 this correspond to?

Not applicable
Author

Your excel file data doesn't come from dates.

robert_mika
Master III
Master III

What's the database are using?

Anonymous
Not applicable
Author

See if this helps:

Re: Date ?

Not applicable
Author

Yes thats a date time field

its value should be 2015-03-19 17:29:09 . but when i am getting it in qvd its getting changed in number

MarcoWedel

Hi,

try with

Timestamp(25569 + EpochTimeField / 86400)


so in your case 1426807749 would result in a timestamp 03/19/2015 23:29:09

Re: UNIX DATE to Qlikview DATE

hope this helps

regards

Marco

Not applicable
Author

Yes you are right Marco date is fine now but i can see the value as 03/19/2015 11:29:09 PM

the date is fine but when i see in time for same field in the earlier data which i was getting it 5:29:09 PM .. is there anything which is missing here

MarcoWedel

maybe localization:

=ConvertToLocalTime(Timestamp(25569 + 1426807749 / 86400),'GMT-06:00')

results in 03/19/2015 5:29:09 PM

Does this match your time zone?

regards

Marco

Not applicable
Author

Thanks .. some of the date value is null which is getting converted 01/01/1970 12:00:00 AM but i want to convert that value to now() i.e. current time