Skip to main content Skip to complementary content

today - script and chart function

This function returns the current date. The function returns values in the DateFormat system variable format.

Syntax:  

today([ timer_mode])

Return data type: dual

The today() function can be used either in the load script or in chart objects.

The default timer_mode value is 1.

Arguments
Argument Description
timer_mode

Can have the following values:

0 (day of last finished data load)
1 (day of function call)
2 (day when the app was opened)

Information noteIf you use the function in a load script, timer_mode=0 will result in the day of the last finished data load, while timer_mode=1 will give the day of the current data load.
Function examples
timer_mode value Result if used in load script Result if used in chart object
0 Returns a date, in the DateFormat system variable format, of the last successful data reload prior to the latest data reload. Returns a date, in the DateFormat system variable format, for the latest data reload.

1

Returns a date, in the DateFormat system variable format, for the latest data reload. Returns a date, in the DateFormat system variable format, of the function call.

2

Returns a date, in the DateFormat system variable format, for when the user’s session in the application began. This will not be updated unless the user reloads the script. Returns the date, in the DateFormat system variable format, for when the user’s session in the application began. This will be refreshed once a new session begins or the data in the application is reloaded.

When to use it

The today() function is commonly used as a component within an expression. For example, it can be used to calculate the interest that has accumulated in a month up to the current date.

The following table provides an explanation of the result returned by the today() function, given different values for the timer_mode argument:

Regional settings

Unless otherwise specified, the examples in this topic use the following date format: MM/DD/YYYY. The date format is specified in the SET DateFormat statement in your data load script. The default date formatting may be different in your system, due to your regional settings and other factors. You can change the formats in the examples below to suit your requirements. Or you can change the formats in your load script to match these examples.

Default regional settings in apps are based on the regional system settings of the computer or server where Qlik Sense is installed. If the Qlik Sense server you are accessing is set to Sweden, the Data load editor will use Swedish regional settings for dates, time, and currency. These regional format settings are not related to the language displayed in the Qlik Sense user interface. Qlik Sense will be displayed in the same language as the browser you are using.

Example 1 – Generation of objects using load script

Example 2 – Generation of objects without load script

Example 3 – Scenario

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!