---
updatedAt: 2025-12-05T18:41:41.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# parse_timestamp

```
parse_timestamp(value: string, format: const string, [timezone: string]?) -> timestamp
```

Parse a string value, whose format is specified by the `format` argument, as a timestamp.

Format specifiers are detailed in [Snowflake's time format specifiers documentation](https://docs.snowflake.com/en/user-guide/date-time-input-output.html#about-the-format-specifiers-in-this-section).

The `format` and `timezone` arguments must be string constants.

If the string value does not match the format of `format`, the result of `parse_timestamp` will be NULL.

If the string value does not contain a timezone, the timezone may be specified in the optional `timezone` argument. `parse_timestamp` will throw an error if the `format` argument contains a timezone and the `timezone` argument is also supplied.
If the `format` argument does not contain a timezone, and `timezone` is also not supplied, the string value will be interpreted as UTC.

If supplied, the `timezone` argument must exactly match one of the following formats:
"07", "+07", "-07" (2 digit hour offset from UTC, optionally preceded by a '+' or '-'),
"0700", "+0700", "-0700", "07:00", "+07:00", "-07:00" (2 digit hour and 2 digit minute offset from UTC, optionally separated by a colon, optionally preceded by a '+' or '-')
The `timezone` argument can also be a [time zone name](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab) or a [link name](https://data.iana.org/time-zones/tzdb-2021a/backward) from release 2021a of the [IANA Time Zone Database](https://www.iana.org/time-zones) (for example, America/Los\_Angeles, Europe/London, UTC, Etc/GMT). Note that we do not support major timezone abbreviations (ex: PDT, EST, etc) because this can refer to several different time zones.

# Domain

This is a scalar function (calculates a single output value for a single input row).

# Categories

* [String](function#string-functions)
* [Time](function#time-functions)

# Examples

<OpalCodeBlock code={
`make_col time:parse_timestamp("2022-09-19 18:38:59.059-05:00", "YYYY-MM-DD HH24:MI:SS.FF3TZH:TZM")
`}/>

Make a new column `time`, of type timestamp, by parsing the string value "2022-09-19 18:38:59.059-05:00" according to the given format string.

<OpalCodeBlock code={
`make_col time:parse_timestamp("2022-09-19 18:38:59.059", "YYYY-MM-DD HH24:MI:SS.FF3")
`}/>

Make a new column `time`, of type timestamp, by parsing the string value "2022-09-19 18:38:59.059" according to the given format string. Since the format string contains no timezone specifier, and the `timezone` argument is not supplied, the value will be interpreted as UTC.

<OpalCodeBlock code={
`make_col time:parse_timestamp("2022-09-19 18:38:59.059", "YYYY-MM-DD HH24:MI:SS.FF3", "-05:00")
`}/>

Make a new column `time`, of type timestamp, by parsing the string value "2022-09-19 18:38:59.059" according to the given format string. The value is interpreted to be in timezone UTC-05:00 based on the `timezone` argument.

<OpalCodeBlock code={
`make_col time:parse_timestamp("Tue, 18 Oct 2022 13:41:26 -0700", "DY, DD MON YYYY HH24:MI:SS TZHTZM")
`}/>

Make a new column `time`, of type timestamp, by parsing the string value "Tue, 18 Oct 2022 13:41:26 -0700" according to the given RFC-2822 format string.

<OpalCodeBlock code={
`make_col time:parse_timestamp("2022-09-19 18:38:59.059", "YYYY-MM-DD HH24:MI:SS.FF3", "America/Los_Angeles")
`}/>

Make a new column `time`, of type timestamp, by parsing the string value "2022-09-19 18:38:59.059" according to the given format string. The value is interpreted to be in timezone America/Los\_Angeles based on the `timezone` argument.