# Timestamp - script and chart function

TimeStamp() formats an expression as a date and time value, in the timestamp format set in the system variables in the data load script, or in the operating system, unless a format string is supplied.

Syntax:

Timestamp(number[, format])

Return data type: dual

Arguments:

Arguments

| Argument | Description |
| --- | --- |
| number | The number to be formatted. |
| format | String describing how the resulting timestamp string is to be formatted. If omitted, the short date format, time format, and decimal separator set in the operating system<br>is used. |

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

#### Examples and results:

The examples below assume the following default settings:

* TimeStampFormat setting 1: YY-MM-DD hh:mm:ss
* TimeStampFormat setting 2: M/D/YY hh:mm:ss

Example:

`Timestamp( 
 A )`   
where A=35648.375

Results table

| Results | Setting 1 | Setting 2 |
| --- | --- | --- |
| String: | 97-08-06<br>09:00:00 | 8/6/97<br>09:00:00 |
| Number: | 35648.375 | 35648.375 |

Example:

`Timestamp( 
 A,'YYYY-MM-DD hh.mm')`   
where A=35648

Results table

| Results | Setting 1 | Setting 2 |
| --- | --- | --- |
| String: | 1997-08-06<br>00.00 | 1997-08-06<br>00.00 |
| Number: | 35648 | 35648 |