Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using QV10 SR2 and I'm a little bit confused about function Today(). In help it states that there are 3 different modes:
0 Date at script run
1 Date at function call
2 Date when the document was opened
Default timer_mode is 2. The timer_mode = 1 should be used with caution, since it polls the operating system every second and hence could slow down the system.
But when I execute it in mode 2 (default) or 0, it gives me old dates. I would expect that...
So, what's wrong then?
See http://qlikviewnotes.blogspot.com/2010/07/now-trap.html for more on this issue. The blog discusses now(), but applies to today() as well.
-Rob
Hi, einsTeln.NET,
I think it is easy, you get allways the systemdate from windows:
2 = date from today only one systemcall at reload the document (not only from Server, even direct reload)
0 = date of the last reload (not only from Server, even direct reload) and this is not like Date(ReloadTime())
1 = date, that is permanently checked with the system
Greetings from Munich
Martina
EVACO GmbH
Yeah, I know that it is looking at system's clock. I already checked if the clock is alright.
Ok, that would mean if I use mode 0 (last reload) and I reload once a day then it would give me always the date of the last day. That is not what I want.
If mode 2 should give me the date when the current reload started then it definitely doesn't work (or in contrast to what is stated in help mode 2 isn't default).
once again:
today() or Today(2) means the systemdate of your computer resp. server.
today(0) is the date of the previous reload
ReloadTime() is the timestamp of your last reload
Yeah, I understand. But Today() [which should be the same like Today(2)] gives me an old date even though the server's system date is correct. I scheduled a reload of that document at about 2 o'clock am and it gives me the date of the day before.
are you sure, that the date on the server is right?
Yes, I checked it several times. I think I'm going mad...
Try the function Now() or Date(Now()) to look at the date of the server. But be careful, it shows every second.
Hi,
Today() returns always using the format stored into the script DateFormat variable (usually at the top of the first tab). Is that format correct? What does it return when you use Now() instead? (Should get the current date and time).
Regards.
Miguel
Now() gives me the current datatime, works! Date format is also correct.