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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Today function reading system clock?

Hello,

I have a report which is to be used for data coming from Houston(CST) as well as from Dubai. Data is modeled similarly hence user can select either houston or Dubai to look at the report. Within this report a lot of my calculations are based on the expression

DayNumberOfYear



(Receive_Dt)=DayNumberOfYear(today())

since this is a daily operations report. This report is automatically re-loaded every 2 hours based on scheduler in houston. What i need clarified is if the today() function will actually show today's date data even for the person in dubai or will only show data for today's date houston where it is re-loaded?

I am assuming it will be based of the system date and should adjust wherever it is viewed from.

Thanks and Regards,

Kiran

9 Replies
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

Yes, it is the system clock in Heuston that is being read. QlikView cannot know what time it is in Dubai!

You could calculate your date as: Date(Floor(Now()+.5))

Stephen

Not applicable
Author

Is it looking at the system clock of houston since it is being re-loaded in houston. i.e is today's date just based on re-load time or is it continously looking at end users system clock?

thanks for the reply

disqr_rm
Partner - Specialist III
Partner - Specialist III

You can store UTC (or GMT) time in your data files usfing function gmt( ) . Then later covert it to local time using ConvertToLocalTime(..) function. This way all times are stored in a common way and converted back to "one" timezone -> QV User Timezone.

Not applicable
Author

Thanks Rakesh,

So if all my data is in one time zone i.e houston, I can have the end user in dubai see the data for today (in dubai using)

converttolocaltime(received_dt)=converttolocaltime(Today())

disqr_rm
Partner - Specialist III
Partner - Specialist III

Yes. Just play with parameters of converttolocaltime() function and you will get what you are looking for.

Not applicable
Author

Hello I am playing around with convert to loacl time function and am confused with some of the results

=

ConvertToLocalTime(Today()) gives output value 8/19/2009 7:00:00 PM



and

=

ConvertToLocalTime(Now()) gives output 8/20/2009 08:47:10 AM and ticking ahead

In houston the current time what my system clock reads is 1:47 PM

Are these values correct in what they are returning?

Thanks kiran.



johnw
Champion III
Champion III

The default for today() is to return the date when the document was opened. You can pass in parameters for other meanings of "today".

The default for now() is to return the date and time when the function was called. You can pass in parameters for other meanings of "now".

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes, those numbers look correct given your function. Huston is GMT-5 so:

Today() would yield midnight of the current day (or the day the doc was opened as John pointed out).

ConvertToLocalTime(Today()) would be midnight minus 5 hours.

ConvertToLocalTime(Now()) would be the current local time minus 5 hours.

ConvertToLocalTime(gmt()) would give the correct current local time -- same as now(1)

-Rob

Not applicable
Author

Thank you all for all the replies.

I understand the expressions now but still feel that none of these are based on teh system clock of the end-user (if so I am unable to test so)

I tried the last expression ConvertToLocalTime(gmt()) and it gives me the correct time at houston - when I change my time zone on my system clock to Dubai, I think this text box value would reflect the time from my system clock.

Maybe Im wrong in my understanding :

what I need to ensure is that

DayNumberOfYear(Receive_Dt)=DayNumberOfYear(today())

where Receive date is in GMT.

So for thsi case I would have to convert receive date to Dubai time as well as today to range from 12 Am to 12AM dubai time.

Which expression would work for me - how would i be able to test from my machine here how the timing is working.

the report is re-loaded every 2 hours with data in houston.

Thanks.