Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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())
I am assuming it will be based of the system date and should adjust wherever it is viewed from.
Thanks and Regards,
Kiran
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
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
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.
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())
Yes. Just play with parameters of converttolocaltime() function and you will get what you are looking for.
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.
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".
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
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.