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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dateadd seconds

Hello that's my first time here! I have a sql column in seconds (10 characters) and i need to add (dateadd in sql), the seconds to one date ex: (2/31/1969 6:00 pm) to extract the spend time since that date ex: dateadd([second],columnname,'12/31/1969 6:00 pm') ¿it's there a way to do this in QlikView? Regards!

1 Solution

Accepted Solutions
Not applicable
Author

Use the functions: ConvertToLocalTime(timestamp(25569+YOURFIELD/24/60/60),'GMT-06:00') where the 'GMT-06:00' it's yout UTC zone enjoy!

View solution in original post

6 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Divide the number of seconds by 86400 and add that to a date: MyNewDateTime = MyDateTime + Seconds/86400


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks! I have a question i have my start datetime field with the format "am/pm" ¿how it works? MyNewDateTime = 2/31/1969 6:00 pm + MyfieldInSeconds/86400 ??? Regards!

Not applicable
Author

Thanks! I have a question i have my start datetime field with the format "am/pm" ¿how it works? MyNewDateTime = 2/31/1969 6:00 pm + MyfieldInSeconds/86400 ??? Regards!

CELAMBARASAN
Partner - Champion
Partner - Champion

Use Date# function to format it to the date format that you going to provide as input.

Qlikview itself process 1 days as integer 1.

You can check it by Num(Today()).

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If it's a string you first need to make it a date. Something like this I think:

MyNewDateTime = date#('2/31/1969 6:00 pm','D/MM/YYYY hh:mm TT') + MyfieldInSeconds/8640



talk is cheap, supply exceeds demand
Not applicable
Author

Use the functions: ConvertToLocalTime(timestamp(25569+YOURFIELD/24/60/60),'GMT-06:00') where the 'GMT-06:00' it's yout UTC zone enjoy!