pjs.getCurrentJobDate()

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 Date object.

Returns

  • Date – A JavaScript Date object 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