When gs.daysAgo is used to populate the value of a field, it does not display correctly if the user has a date format different from the default.

Steps to Reproduce 

  1. Open a record producer.
  2. Create a new Date/Time type variable with a default value of javascript:gs.daysAgo(-5).
  3. Run the record producer.
    The variable appears as expected.
  4. Change a sys_user record to use MM-dd-yyyy as their date format.
  5. Run the record producer again with this user.
    The date field is still populated, but the date looks incorrect:

    System Default: 2014-07-29 21:15:09
    MM-dd-yyyy format: 10-07-0196 21:15:09


Pass gs.daysAgo into a new GlideDateTime record and then obtain the display value of that new record.

For example, instead of using:


as a default value, use the following:

javascript: new GlideDateTime(gs.daysAgo(-5)).getDisplayValue();

Related Problem: PRB604613

Seen In

Dublin Patch 1 Hot Fix 1

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-05-15 07:56:54