FormatDateTime

Mon 01 January 2018

Syntax

FormatDateTime(datetime, {timezone | "Local" | "Base"}, displayTZ)

Description

Use the FormatDateTime function to take a datetime value and convert it to text. If a specific time zone abbreviation, or a field reference, is passed in timezone , FormatDateTime adjusts the DateTime to the user’s local time zone instead of the specified time zone. The system’s base time zone is specified on the PSOPTIONS table. The value datetime is assumed to be in base time.

See .

If Local is specified for time zone, FormatDateTime adjusts the DateTime to the user’s local time zone instead of a specific time zone.

If True is specified for displayTZ , FormatDateTime appends the time zone abbreviation to the returned string.

Parameters

Field or Control

Definition

datetime

Specify the DateTime value to be formatted.

timezone | Local | Base

Specify a value for converting datetime . The values are:

  • timezone - a time zone abbreviation or a field reference to be used for converting datetime .

  • Local - use the local time zone for converting datetime.

  • Base - use the base time zone for converting datetime .

displayTZ

Specify whether the time zone abbreviation should be appended to the returned string. This parameter takes a Boolean: True if the abbreviation should be appended, False, otherwise.

Returns

A formatted string value.