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

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

# gsql_month()

Returns the month number (1-12) from a timestamp.

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

`%Y` is a four-digit year.`%m` is the month number between 1 and 12.`%d` is the day number between 1 and 31.

## Syntax

`gsql_month(timestamp)`

## Parameters

timestamp

Required. A timestamp.

## Return type

`INT`

## Example

gsql_year("2013-05-09 23:56:52") -> 5
