# Date# - script and chart function

Date# evaluates an expression as a date in the format specified in the second argument, if supplied.

Syntax:

Date#(text[, format])

Return data type: dual

Arguments:

Arguments

| Argument | Description |
| --- | --- |
| text | The text string to be evaluated. |
| format | String describing the format of the text string to be evaluated. If omitted, the date format set in the system variables in the data load script or the operating system<br>is used.<br><br>[Descriptions for number and time formats](https://help.qlik.com/en-US/sense/May2025/Subsystems/Hub/Content/Sense_Hub/Introduction/conventions-number-time-formats.htm) |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/InterpretationFunctions/date_hash.htm)

#### Examples and results:

The following example uses the date format M/D/YYYY. The date format is specified in the SET DateFormat statement at the top of the data load script.

Add this example script to your app and run it.

`Load *,` `Num(Date#(StringDate)) as Date;` `LOAD * INLINE [` `StringDate` `8/7/97` `8/6/1997` `]`

If you create a table with StringDate and Date as dimensions, the results are as follows:

Results

| StringDate | Date |
| --- | --- |
| 8/7/97 | 35649 |
| 8/6/1997 | 35648 |