Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
jpjust
Specialist
Specialist

Last 8 Hours

Hi,

I need  a confirmation on an expression here.

Below is an expression for Last 4 Hours.

Let vLast4Hours = Num(timestamp(Now(1)-1/6)); /// 4 hours = 1 day / 24 hours (per day) * 4 hours = 1/6 Days

How can I do the same for Last 8 Hours?

I am having the following expression for Last 8 Hours. Is this correct?

Let vLast4Hours = Num(timestamp(Now(1)-1/3)); /// 4 hours = 1 day / 24 hours (per day) * 8 hours = 1/3 Days

Thanks

2 Solutions

Accepted Solutions
stevejoyce
Specialist II
Specialist II

That is correct.

You could simply put this calculation in a text box and also verify for your self

=timestamp(Now(1)-1/3)

View solution in original post

stevejoyce
Specialist II
Specialist II

I guess you can add 3 hours to it then.

=timestamp(now()-(11/24)).

 

You could look at the converttolocatime() function with a time of UTC() (current time in UTC).  I use New York because it changes to EST or EDT if daylight savings is currently being observed in NY.

=ConvertToLocalTime(UTC(),'New York')

View solution in original post

3 Replies
stevejoyce
Specialist II
Specialist II

That is correct.

You could simply put this calculation in a text box and also verify for your self

=timestamp(Now(1)-1/3)

jpjust
Specialist
Specialist
Author

Thanks. That works.

My qliksense server is in Pacific time zone (- 3 hrs EST)

The output that you see below is in 12:41 - 8 hrs = 4:41 AM

How can I calculate the same expression to display it on EST as 7:41 AM?

jpjust_0-1631043968125.png

Thanks

stevejoyce
Specialist II
Specialist II

I guess you can add 3 hours to it then.

=timestamp(now()-(11/24)).

 

You could look at the converttolocatime() function with a time of UTC() (current time in UTC).  I use New York because it changes to EST or EDT if daylight savings is currently being observed in NY.

=ConvertToLocalTime(UTC(),'New York')