# Time# - 指令碼與圖表函數

Time#() 將運算式作為時間值進行評估，使用在資料載入指令碼或作業系統 (除非提供格式字串) 中設定的時間格式。

語法：

time#(text[, format])

傳回的資料類型： 雙值

引數：

引數

| 引數 | 描述 |
| --- | --- |
| text | 要評估的文字字串。 |
| format | 描述待評估的文字字串格式之字串。如果省略，則會使用作業系統中設定的簡短日期格式、時間格式和小數點分隔符號。<br><br>[數字格式與時間格式的描述](https://help.qlik.com/zh-TW/sense/May2025/Subsystems/Hub/Content/Sense_Hub/Introduction/conventions-number-time-formats.htm) |

範例：

* 時間格式預設設定 1： hh:mm:ss
* 時間格式預設設定 2： hh.mm.ss

`time#( A )`   
其中 A=09:00:00

結果

| 結果 | 設定 1 | 設定 2 |
| --- | --- | --- |
| 字串： | 09:00:00 | 09:00:00 |
| 數字： | 0.375 | - |

範例：

* 時間格式預設設定 1： hh:mm:ss
* 時間格式預設設定 2： hh.mm.ss

`time#( 
 A, 'hh.mm' )`   
其中 A=09.00

結果

| 結果 | 設定 1 | 設定 2 |
| --- | --- | --- |
| 字串： | 09.00 | 09.00 |
| 數字： | 0.375 | 0.375 |