> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/reference/workflows/transforms/variable-creation-methods/time.md).

# Time

### Current time

Returns the current time –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#current_time)

```sql
CURRENT_TIME([@time_zone])
```

#### Return type

time

#### Parameters

| Name         | Type                                                                                                               | Allowed values                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Required | Placeholder (in UI) |
| ------------ | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------- |
| `@time_zone` | [enum](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#enum) | any of: `ACDT`, `ACST`, `ACT`, `ACT`, `ACWST`, `ADT`, `AEDT`, `AEST`, `AFT`, `AKDT`, `AKST`, `AMST`, `AMT`, `AMT`, `ART`, `AST`, `AST`, `AWST`, `AZOST`, `AZOT`, `AZT`, `BDT`, `BIOT`, `BIT`, `BOT`, `BRST`, `BRT`, `BST`, `BST`, `BST`, `BTT`, `CAT`, `CCT`, `CDT`, `CDT`, `CEST`, `CET`, `CHADT`, `CHAST`, `CHOT`, `CHOST`, `CHST`, `CHUT`, `CIST`, `CIT`, `CKT`, `CLST`, `CLT`, `COST`, `COT`, `CST`, `CST`, `CST`, `CT`, `CVT`, `CWST`, `CXT`, `DAVT`, `DDUT`, `DFT`, `EASST`, `EAST`, `EAT`, `ECT`, `ECT`, `EDT`, `EEST`, `EET`, `EGST`, `EGT`, `EIT`, `EST`, `FET`, `FJT`, `FKST`, `FKT`, `FNT`, `GALT`, `GAMT`, `GET`, `GFT`, `GILT`, `GIT`, `GMT`, `GST`, `GST`, `GYT`, `HDT`, `HAEC`, `HST`, `HKT`, `HMT`, `HOVST`, `HOVT`, `ICT`, `IDLW`, `IDT`, `IOT`, `IRDT`, `IRKT`, `IRST`, `IST`, `IST`, `IST`, `JST`, `KALT`, `KGT`, `KOST`, `KRAT`, `KST`, `LHST`, `LHST`, `LINT`, `MAGT`, `MART`, `MAWT`, `MDT`, `MET`, `MEST`, `MHT`, `MIST`, `MIT`, `MMT`, `MSK`, `MST`, `MST`, `MUT`, `MVT`, `MYT`, `NCT`, `NDT`, `NFT`, `NPT`, `NST`, `NT`, `NUT`, `NZDT`, `NZST`, `OMST`, `ORAT`, `PDT`, `PET`, `PETT`, `PGT`, `PHOT`, `PHT`, `PKT`, `PMDT`, `PMST`, `PONT`, `PST`, `PST`, `PYST`, `PYT`, `RET`, `ROTT`, `SAKT`, `SAMT`, `SAST`, `SBT`, `SCT`, `SDT`, `SGT`, `SLST`, `SRET`, `SRT`, `SST`, `SST`, `SYOT`, `TAHT`, `THA`, `TFT`, `TJT`, `TKT`, `TLT`, `TMT`, `TRT`, `TOT`, `TVT`, `ULAST`, `ULAT`, `UTC`, `UYST`, `UYT`, `UZT`, `VET`, `VLAT`, `VOLT`, `VOST`, `VUT`, `WAKT`, `WAST`, `WAT`, `WEST`, `WET`, `WIT`, `WST`, `YAKT`, `YEKT` | false    | *(UTC (default))*   |

### Format time

Returns a formatted string from a time –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#format_time)

```sql
FORMAT_TIME(@format_string, @time_expression)
```

#### Return type

string

#### Parameters

| Name               | Type                                                                                                                                                                                                                                                   | Allowed values                                                             | Required | Placeholder (in UI) |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | -------- | ------------------- |
| `@time_expression` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [time](https://docs.redivis.com/reference/datasets/variables#time)     | true     | -                   |
| `@format_string`   | [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal)                                                                                                                               | any [string](https://docs.redivis.com/reference/datasets/variables#string) | true     | *(e.g., %H:%M:%S)*  |

More details about format strings [here](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#format-elements-for-dates-and-time)

### Parse time

Parses a time from a string –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#parse_time)

```sql
[@safe]PARSE_TIME(@format_string, @time_string)
```

#### Return type

time

#### Parameters

| Name             | Type                                                                                                                                                                                                                                                   | Allowed values                                                               | Required | Placeholder (in UI) |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------- | ------------------- |
| `@time_string`   | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [string](https://docs.redivis.com/reference/datasets/variables#string)   | true     | -                   |
| `@format_string` | [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal)                                                                                                                               | any [string](https://docs.redivis.com/reference/datasets/variables#string)   | true     | *(e.g., %H:%M:%S)*  |
| `@safe`          | [boolean](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#boolean)                                                                                                                               | any [boolean](https://docs.redivis.com/reference/datasets/variables#boolean) | true     | -                   |

More details about format strings [here](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#format-elements-for-dates-and-time)

### New time

Constructs a time from an hour, minute, and second –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#time)

```sql
TIME(@hour, @minute, @second)
```

#### Return type

time

#### Parameters

| Name      | Type                                                                                                                                                                                                                                                   | Allowed values                                                               | Required | Placeholder (in UI) |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------- | ------------------- |
| `@hour`   | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [integer](https://docs.redivis.com/reference/datasets/variables#integer) | true     | -                   |
| `@minute` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [integer](https://docs.redivis.com/reference/datasets/variables#integer) | true     | -                   |
| `@second` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [integer](https://docs.redivis.com/reference/datasets/variables#integer) | true     | -                   |

### Time add

Add a period of time to a time –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#time_add)

```sql
TIME_ADD(@time_expression, INTERVAL @integer_expression @time_part)
```

#### Return type

time

#### Parameters

| Name                  | Type                                                                                                                                                                                                                                                   | Allowed values                                                               | Required | Placeholder (in UI) |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------- | ------------------- |
| `@integer_expression` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [integer](https://docs.redivis.com/reference/datasets/variables#integer) | true     | -                   |
| `@time_part`          | [enum](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#enum)                                                                                                                                     | any of: `hour`, `minute`, `second`, `millisecond`, `microsecond`             | true     | *((e.g., hours))*   |
| `@time_expression`    | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [time](https://docs.redivis.com/reference/datasets/variables#time)       | true     | -                   |

### Time diff

Calculate distance between two times –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#time_diff)

```sql
TIME_DIFF(@time_expression, @time_expression_2, @time_part)
```

#### Return type

integer

#### Parameters

| Name                 | Type                                                                                                                                                                                                                                                   | Allowed values                                                         | Required | Placeholder (in UI) |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- | -------- | ------------------- |
| `@time_expression_2` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [time](https://docs.redivis.com/reference/datasets/variables#time) | true     | -                   |
| `@time_expression`   | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [time](https://docs.redivis.com/reference/datasets/variables#time) | true     | -                   |
| `@time_part`         | [enum](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#enum)                                                                                                                                     | any of: `hour`, `minute`, `second`, `millisecond`, `microsecond`       | true     | *((e.g., hours))*   |

### Time subtract

Subtract a period of time from a time –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#time_sub)

```sql
TIME_SUB(@time_expression, INTERVAL @integer_expression @time_part)
```

#### Return type

time

#### Parameters

| Name                  | Type                                                                                                                                                                                                                                                   | Allowed values                                                               | Required | Placeholder (in UI) |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------- | ------------------- |
| `@integer_expression` | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [integer](https://docs.redivis.com/reference/datasets/variables#integer) | true     | -                   |
| `@time_part`          | [enum](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#enum)                                                                                                                                     | any of: `hour`, `minute`, `second`, `millisecond`, `microsecond`             | true     | *((e.g., days))*    |
| `@time_expression`    | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [time](https://docs.redivis.com/reference/datasets/variables#time)       | true     | -                   |

### Time truncate

Truncates a time to the nearest boundary –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#time_trunc)

```sql
TIME_TRUNC(@time_expression, @time_truncate_part)
```

#### Return type

time

#### Parameters

| Name                  | Type                                                                                                                                                                                                                                                   | Allowed values                                                         | Required | Placeholder (in UI) |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- | -------- | ------------------- |
| `@time_expression`    | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [time](https://docs.redivis.com/reference/datasets/variables#time) | true     | -                   |
| `@time_truncate_part` | [enum](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#enum)                                                                                                                                     | any of: `hour`, `minute`, `second`, `millisecond`, `microsecond`       | true     | *((e.g., hours))*   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/reference/workflows/transforms/variable-creation-methods/time.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
