TO_DATETIME

Converts text to a datetime format

Updated over a week ago

Description

The TO_DATETIME() function is used to convert text data into a datetime format. This is useful when you have text-based datetime values and need to work with them in date and time calculations or comparisons.

Syntax

TO_DATETIME(text)

Output

datetime

Variables

  1. text: The text data representing the datetime that you want to convert into a datetime format. It should be in a recognizable datetime format, such as "YYYY-MM-DD HH:MM:SS."

Example

TO_DATETIME(CONCAT(TO_DATE(Registration Date`)," ",Registration Time`))

Name

Registration Date

Registration Time

TO_DATETIME

Giacomo

April 22, 2024

20:21:42

2024-04-22T16:21:42000-04:00

Kameko

May 22, 2024

11:30:38

2024-05-22T07:30:38000-04:00

Anne

May 3, 2024

13:11:30

2024-05-03T09:11:30000-04:00

Orlando

July 25, 2024

2:29:42

2024-07-24T22:29:42000-04:00

Nasim

December 11, 2023

13:29:58

2023-12-11T08:29:58000-05:00

Did this answer your question?