Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can anyone please explain the difference between now() and today() with respect to below two expressions as they are giving me different outputs
=(date(now(),'DD/MM/YYYY')) - Output is 28/01/2014;
whereas =(date(today(),'DD/MM/YYYY')) - Output is 24/01/2014
But,when I copy this application to a new application both the expressions give the same result as 28/01/2014.But in an application which is already in use the outputs differ as mentioned above.Can anyone Please explain the reason behind this difference
Hi,
There is something called as Time Mode. Default Timer Mode for Today and Now differ.See the below explanation from Qlikview Help.
Since the default Timer Mode for Today() is 2 which returns the Date when the document was opened whereas for Now() default timer mode is 1 which returns Time at Function call hence the difference in the dates in your case.
Returns a timestamp of the current time from the system clock. The timer_mode may have the following values:
0 Time at script run
1 Time at function call
2 Time when the document was opened
Defaulttimer_mode is 1. The timer_mode = 1 should be used with caution, since it polls the operating system every second and hence could slow down the system.
Returns the current date from the system clock. The timer_mode may have the following values:
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.
Hope this helps!
Hi,
today() function will give you the Date.
but now() will give you Date along with timestamp.
and if possible please attach sample qvw .
-Nilesh
Hi,
There is something called as Time Mode. Default Timer Mode for Today and Now differ.See the below explanation from Qlikview Help.
Since the default Timer Mode for Today() is 2 which returns the Date when the document was opened whereas for Now() default timer mode is 1 which returns Time at Function call hence the difference in the dates in your case.
Returns a timestamp of the current time from the system clock. The timer_mode may have the following values:
0 Time at script run
1 Time at function call
2 Time when the document was opened
Defaulttimer_mode is 1. The timer_mode = 1 should be used with caution, since it polls the operating system every second and hence could slow down the system.
Returns the current date from the system clock. The timer_mode may have the following values:
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.
Hope this helps!
In both the case, You are defining your Date format, that's why same result...
To be more specific below 2 syntax will result in same output. where 1 stands for current function call.
=date(today(1),'DD/MM/YYYY')
=date(now(),'DD/MM/YYYY')