datetime.formatDatetime

This function displays the date and time according to the specified format. The format uses MM(month), DD(day), YYYY(year), hh(hour), mm(minute), and ss(second). Except for MM, the others are not case-sensitive.

Syntax

datetime.formatDatetime(datetime, format)

Arguments

Argument

Type

Description

datetime

datetime

Date and time to be formatted.

format

string

Format to be used for the date and time.

Returns

Type

Description

string

Datetime in the specified format.

Examples

The function datetime.formatDatetime("2017-04-10T22:17:32.000+0700", "dd/MM/yyyy T hh:mm:ss") returns 10/04/2017 T 22:17:32.