pjs.getCurrentJobDate()
Release Version: 7.24
Returns the current job or session date as a JavaScript Date object.
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.
The return value is always a JavaScript
Dateobject.
Returns
Date – A JavaScript
Dateobject representing the job/session date.
Examples
// Example 1: Get job date as a Date object
const jobDate = pjs.getCurrentJobDate();
console.log(jobDate.toISOString());
// Result: "2025-09-02T00:00:00.000Z"
// Example 2: Format with moment.js
const moment = require("moment");
const jobDate = pjs.getCurrentJobDate();
console.log(moment(jobDate).format("MM/DD/YYYY"));
// Result: "09/02/2025"
See Also
getCurrentJobDateNumeric() – Returns the job/session date in numeric
MMDDYYYYorMMDDYYformat.