DateTimeToUserFormat

Mon 01 January 2018

Syntax

DateTimeToUserFormat(textdatetime, {timezone | "Local" | "Base"})

Description

Use the DateTimeToUserFormat function to convert the string value textdatetime in PeopleSoft internal date/time format to a date/time value in the user's personalized date/time format for a specified time zone.

The format for the return value is determined in the following order of precedence:

  1. User personalizations if they exist.

  2. If there are no user personalizations, then any format specified by the browser language setting in PSLOCALEDEFN.

  3. If there are no user personalizations and there is no browser session to determine the browser language settings (for example, when running an Application Engine program directly in Application Designer), the system’s regional language setting is used to determine the format.

For example, if the user's date and time format personalization settings are DDMMYY and 24-hour clock, the following function invocation returns a DateTime string equal to 27/09/2011 08:00:00 .

&DTM = DateTimeToUserFormat("2011-09-27 08:00:00.000000", "Base");

Parameters

Field or Control

Definition

textdatetime

Specifies a String value representing a date/time value in the PeopleSoft internal format: YYYY - MM - DD hh : mm : ss . SSSSSS (for example, 1999-01-01 19:20:30.000000)

In which:

  • YYYY is a four-digit year.

  • MM is a two-digit month (01 through 12).

  • DD is a two-digit day of the month (01 through 31).

  • hh is two digits of hour (00 through 23).

  • mm is two digits of minute (00 through 59).

  • ss is two digits of second (00 through 59).

  • S is milliseconds in one or up to six digits.

timezone | "Local" | "Base"

Specifies a String value to indicating the time zone to convert to. The values are:

  • timezone – A time zone abbreviation or a field reference.

  • "Local" – Use the local time zone.

  • "Base" – Use the base time zone.

Returns

Returns a DateTime value in user format for the specified time zone.