ConvertDatetimeToBase function

Syntax

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

Description

Use the ConvertDatetimeToBase function to convert the text value textdatetime to a DateTime value. The ConvertDatetimeToBase function then further converts it from the specified time zone to the base time zone. This function automatically calculates whether daylight saving time is in effect for the given textdatetime and time zone.

The system’s base time zone is specified in the PSOPTIONS table.

Parameters

Parameter Description

textdatetime

Specify a date/time represented as text in the PeopleSoft internal format: yyyy - mm - dd hh : mm : ss[. S] (for example, "2011-01-01 18:10:52.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 a two digits of hour (00 through 23).

  • mm is a 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

Specify a value for converting textdatetime. Values are:

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

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

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

Returns

Returns a DateTime value in the base time zone.

Example

In the following example, assuming the base time (as defined in PSOPTIONS) is PST, &DATETIMEVAL would have a DateTime value of "1999-01-01 07:00:00.000000":

&DATETIMEVAL= ConvertDateTimeToBase("1999-01-01 10:00:00.000000", "EST");