---
title: "gsql_ts_to_epoch_seconds()"
component: "gsql-ref"
version: "3.11"
module: "ddl-and-loading"
html_url: "/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_ts_to_epoch"
canonical_url: "https://www.tigergraph.com/docs/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_ts_to_epoch"
markdown_url: "https://www.tigergraph.com/docs/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_ts_to_epoch.md"
---

[View as HTML](https://www.tigergraph.com/docs/gsql-ref/3.11/ddl-and-loading/functions/token/gsql_ts_to_epoch)

# gsql_ts_to_epoch_seconds()

Converts a timestamp in canonical string format to Unix epoch time, which is the number of seconds since Jan 1st, 1970.

The timestamp parameter should be in one of the following formats:

* `"%Y-%m-%d %H:%M:%S"`
* `"%Y/%m/%d %H:%M:%S"`
* `"%Y-%m-%dT%H:%M:%S.000z"`  
   * Text after the dot `.` is ignored

## Syntax

`gsql_ts_to_epoch_seconds(timestamp)`

## Parameters

timestamp

Required. The timestamp to convert to Unix epoch time.

## Return type

`UINT`

## Example

gsql_ts_to_epoch_seconds("2022-06-30 22-08-28") -> 1656652105
