DATETIME

Creates a datetime based on the provided year, month, day, hour, minute, and second values

Description

The DATETIME function generates a datetime by combining the specified year, month, day, hour, minute, and second values. This is useful for creating precise datetime records or working with timestamped data.

Syntax

DATETIME(year, month, day, hour, minute, second)

  1. year: The numeric value representing the year (e.g., 2023).

  2. month: The numeric value representing the month (1 for January, 2 for February, and so on).

  3. day: The numeric value representing the day of the month.

  4. hour: The numeric value representing the hour (0-23).

  5. minute: The numeric value representing the minute (0-59).

  6. second: The numeric value representing the second (0-59).

Example

Table

Event
Year
Month
Day
Hour
Minute
Second

Event A

2023

9

15

10

30

45

Event B

2023

8

25

14

15

0

Event C

2023

9

1

9

0

20

Function

DATETIME(`Year`, `Month`, `Day`, `Hour`, `Minute`, `Second`)

Results

DATETIME (datetime)

2023-09-15T10:30:45.000Z

2023-08-25T14:15:00.000Z

2023-09-01T09:00:20.000Z

Last updated