- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 07:49 AM
I have a UI Action that produces knowledge articles for the changes related to a release. I use the following to calculate the "valid_to" date on the article record:
gr.valid_to = gs.yearsAgo(-7);
This as work consistently for over a year but a single user has reported and issue. On more than one occasion, the date for this user calculated to "0184-09-01" when it was expected to be "2025-01-16". I have been able to reproduce the issue but not consistently.
Can anyone shed some light on this behavior?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2018 09:58 AM
It turns out "GlideSystem" Date and Time Functions can cause unexpected behaviour when used for setting fields, as gs.yearsAgo returns a date in a constant format, designed to be used for database queries instead.
Use the "GlideDateTime", "getDate", and "getDisplayValue" instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2022 08:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 01:07 PM
Any ideas or does this warrant an incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2018 09:58 AM
It turns out "GlideSystem" Date and Time Functions can cause unexpected behaviour when used for setting fields, as gs.yearsAgo returns a date in a constant format, designed to be used for database queries instead.
Use the "GlideDateTime", "getDate", and "getDisplayValue" instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2022 08:22 AM
You can use this Script Include to get the Years ago date.