Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jayati_shrivast
Contributor III

adding hours to time

Hi All,

I have a date-time field in the format MM-DD-YYYY hh:mm:ss. I need to add 10 hours to this field. currently the time is in UTC , I need to convert it to local system time. How can I implement this?

pls help.

4 Replies
lblumenfeld
Partner Ambassador

=Date(YourFieldName + (10/24), 'DD/MM/YYYY hh:mm:ss')

You may have to use

=Date(Date#(YourFieldName, 'DD/MM/YYYY hh:mm:ss') + (10/24), 'DD/MM/YYYY hh:mm:ss')

or, if it's a variable

=Date(Date#('$(YourFieldName)', 'DD/MM/YYYY hh:mm:ss') + (10/24), 'DD/MM/YYYY hh:mm:ss')

jayati_shrivast
Contributor III
Author

thanks .. will implement this.

lblumenfeld
Partner Ambassador

Great. Please mark the solution as correct if it works for you.

gandalfgray
Specialist II

Hi Jayati

I suggest you use the ConvertToLocalTime(timestamp [, place [, ignore_dst=false]]) function:

https://help.qlik.com/en-US/sense/September2018/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTi...