DATE_PARSE

All functions > DATE_AND_TIME > DATE_PARSE

Returns a timestamp from the given string and format.

Syntax

DATE_PARSE(string, format)
sql

Arguments

ParameterTypeRequiredDescription
stringVARCHARYesThe date/time string to parse
formatVARCHARYesThe format string matching the input (e.g., '%Y-%m-%d')

Returns

A TIMESTAMP value parsed from the string

Notes

  • Parses date/time string according to the specified format
  • Format uses strftime-style placeholders matching the input
  • Returns NULL if the string doesn't match the format
  • Inverse of DATE_FORMAT
  • Useful for parsing custom date formats from external sources

Examples

Last update at: 2025/10/13 10:23:46