DateTime (FPScript)

21.09.2021

The function forms a calendar time value from individual date and time elements.

Syntax

DateTime(Month, Day, Year, [ Hour = 0 ], [ Minute = 0 ] [ , Second = 0 ])
or
DateTime(Month, Day, Year, Hour, Minute, Second, Timezone)

 

The syntax of the DateTime function consists of the following parts:

Part

Description

Month

The month of the date.

Permitted data structures are scalar value und data series. All real data types are permitted.

Day

The day of the date.

Permitted data structures are scalar value und data series. All real data types are permitted.

Year

The year of the date. Can be specified with two or four digits.

Permitted data structures are scalar value und data series. All real data types are permitted.

Hour

The hour of the date.

Permitted data structures are scalar value und data series. All real data types are permitted. The argument is transformed to the unit h.

If this argument is omitted, it will be set to the default value 0.

Minute

The minute of the date.

Permitted data structures are scalar value und data series. All real data types are permitted. The argument is transformed to the unit min.

If this argument is omitted, it will be set to the default value 0.

Second

The second of the date.

Permitted data structures are scalar value und data series. All real data types are permitted. The argument is transformed to the unit s.

If this argument is omitted, it will be set to the default value 0.

Timezone

The time zone in which the date elements are to be interpreted, as a time shift in hours from Coordinated Universal Time (UTC). If you omit the argument, the date elements are interpreted in local time.

Permitted data structures are scalar value. Supported data types are 16-bit integer, 32-bit integer, 64-bit integer, 32-bit floating point, 64-bit floating point und time span.

Remarks

The result corresponds to the specified date. If an invalid date is entered, for example one before 1.1.1970, then the function passes an invalid calendar time value.

If an argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Note        You can also write constant calendar time values directly as FPScript constants.

Available in

FlexPro View, Basic, Professional, Developer Suite

Examples

DateTime(1, 25, 2004, 0, 0, 0)

Results in '25.1.2004 00:00:00'.

DateTime(1, 25, 04, 12, 34, 45.6)

Results in '25.1.2004 12:34:45.6'.

See Also

Time Function

CurrentDate Function

Data Types

Share article or send as email:

You might be interested in these articles

Weisang GmbH

Sophie-Krämer-Straße 13
D-66386 St. Ingbert
Germany

Tel. +49 6894 929600
Fax. +49 6894 92960 26

Company