pjs.getCurrentJobDateNumeric()

pjs.getCurrentJobDateNumeric()

This API was added in version 7.24.

Description

The pjs.getCurrentJobDateNumeric() API returns the current job or session date as a numeric value, in either 6-digit or 8-digit format depending on the length specified.

Parameters

  1. Length (optional) - The desired length of the numeric return value. 6 returns 6-digit format (MMDDYY, DDMMYY, or YYMMDD, depending on the job date format). 8 returns 8-digit format (MMDDYYYY, DDMMYYYY, or YYYYMMDD, depending on the job date format). The default is 8.

Return Value

The current job or session date, as a number in either 6-digit or 8-digit format.

Behavior

  • Uses the job or session date returned by pjs.getCurrentJobDate().

  • Honors the job’s date format (*MDY, *DMY, or *YMD), or the override in controlOptions.dateEdit.

  • Defaults to *MDY if no format is specified.

  • Formats the date according to the specified length and returns it as a number.

Examples

Example 1: Default 8-Digit Format

pjs.getCurrentJobDateNumeric(); // Returns: 7162025 (for July 16, 2025 in *MDY format)

Example 2: Explicit 6-Digit Format

pjs.getCurrentJobDateNumeric(6); // Returns: 71625 (for July 16, 2025 in *MDY format)

RPG Equivalent

*DATE


Related Pages