datetime.create

This function creates a date by using the specified details. The details such as year, months, days, hours, minutes, seconds, nanoseconds, and timezone. The timezone follows the IANA time zone.

Syntax

datetime.create(0, 0, 0, 0, 0, 0, 0, UTC) 

Arguments

Argument

Type

Description

years

int

The default is 0.

months

int

The default is 0.

days

int

The default is 0.

hours

int

The default is 0.

mins

int

The default is 0.

secs

int

The default is 0.

nsecs

int

The default is 0.

location

string

The default is UTC.

Returns

Type

Description

datetime

A date created by using the specified details. The details such as year, months, days, hours, mins, seconds, nanoseconds, and timezone.

Examples

The function datetime.create(2020,1,3,2,22,0,0, "America/Los_Angeles") returns 2020-01-03T02:22:00-08:00.