pjs.getCurrentJobDate()
This API was added in version 7.24.
Description
The pjs.getCurrentJobDate() API returns the current job or session date as a JavaScript Date object.
Parameters
None.
Return Value
A JavaScript Date object representing the job or session date.
Behavior
If a job date has been explicitly set in the session, that date is returned.
Otherwise, the session start time is used.
If neither is available, the current system date is returned.
Examples
Example 1: Get the Job Date as a Date Object
const jobDate = pjs.getCurrentJobDate();
console.log(jobDate.toISOString());
// Result: "2025-09-02T00:00:00.000Z"Example 2: Format the Job Date With moment.js
const moment = require("moment");
const jobDate = pjs.getCurrentJobDate();
console.log(moment(jobDate).format("MM/DD/YYYY"));
// Result: "09/02/2025"RPG Equivalent
*DATE