Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Create story UI action causes incorrect time value to be inserted - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Create story UI action causes incorrect time value to be inserted
KB0524268

Create story UI action causes incorrect time value to be inserted


875 Views Last updated : Oct 17, 2023 public Copy Permalink
KB Summary by Now Assist

Description

The Create story UI action on the Enhancement and Defect tables is updating the Opened field with the incorrect time. Regardless of the time zone selected, records created using this UI action are displaying the current time in the UTC/PST time zone.

Workaround

In the affected UI actions, insert the following at line 23:

var ajax = new GlideAjax('DateTimeFix');
ajax.addParam('sysparm_name','dateTimeFix');
ajax.getXMLWait();
var newTime = ajax.getAnswer();
values["opened_at"] = newTime;

Create a script include called DateTimeFix, client callable, with the following script:

var DateTimeFix = Class.create();

DateTimeFix.prototype = Object.extendsObject(AbstractAjaxProcessor, {

dateTimeFix: function() {
return gs.hoursAgo(14);
}
});

***This tricks the bug by setting the time back 14 hours (two times the PST offset) and results in the opened_at time being set correctly. This would only work for PST, but could be adjusted for other time zones statically, or with additional logic per user TZ. 


Related Problem: PRB586748

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.