gs.datediff servicenow. Please note: These APIs are provided to support legacy applications in. gs.datediff servicenow

 
 Please note: These APIs are provided to support legacy applications ings.datediff servicenow  Please note: These APIs are provided to support legacy applications in

getValue('the_date_field'), g_user_date_format); var my_date = new Date( date_number); Or, from a Date/Time. gs. DATEDIFF accepts either. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. getDisplayValue () in a GlideDateTime constructor - Support and Troubleshooting - Now Support Portal. dateDiff() returns the same value for the difference between date1/date2 and date1/date3 even though there is a 10 minute difference. It is recommended that new. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. The first parameter identifies the start date, the second parameter identifies the end date, and the third. Please note: These APIs are provided to support legacy applications in. It is recommended that new. We would like to show you a description here but the site won’t allow us. calendar_duration = gs. dateDiff. . ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. EventQueue. Problems can occur when using gs. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Right-click the form header and select Configure > Form Layout. RiseUp with ServiceNow Forum. getDisplayValueInternal(),false);} How do I use GlideAjax Servicenow? Create a GlideAjax instance by calling the GlideAjax constructor. `var diff = gs. Please note: The APIs below are intended for scoped applications and. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. getUserByID () Returns a reference to the user object for the user ID (or sys_id) provided. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Parameters: Name of the event being queued. Please note: These APIs are provided to support legacy applications in. dateDiff(gs. gr. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. Please note: These APIs are provided to support legacy applications in the global scope. Please note: These APIs are provided to support legacy applications in the global scope. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. Please note: These APIs are provided to support legacy applications in. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. This method expects the earlier date as the first parameter and the later date as the second parameter; otherwise, the method returns the difference as a negative value. Please note: These APIs are provided to support legacy applications in. var gdt = new GlideDateTime ("2011-12-02 12:00:00"); //December gs. dateDiff(firstDay, lastDay, true) < 0)ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. dateDiff () (Global GlideSystem) returns invalid results - Support and Troubleshooting - Now Support Portal Loading. The most relevant topics (based on weighting and matching to search terms) are listed first in search results. function getRecordsWithMoreThanXMinutes(table, query, field1, field2, mins)ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. The gs. dateDiff and gs. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. dateDiff (current. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. We would like to show you a description here but the site won’t allow us. It is recommended that new. ServiceNow provides very good support when you are working with time & dates. Please note: These APIs are provided to support legacy applications in. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. start_date. Please note: These APIs are provided to support legacy applications in the global scope. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. You can add or remove days from a GlideDateTime () object using the addDays () method. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Please note: These APIs are provided to support legacy applications in. We would like to show you a description here but the site won’t allow us. Skip to page contentServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. nowDateTime() or GlideDateTime. Please note: These APIs are provided to support legacy applications in. u_duration_2, false); Works on the server (e. Please note: These APIs are provided to support legacy applications in. getDisplayValue gives me undefined when writing to the work log and makes my time difference negative in gs. ostartDate = current. We would like to show you a description here but the site won’t allow us. Please note: These APIs are provided to support legacy applications in. getUser () Returns a reference to the user object for the currently logged-in user. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Please note: These APIs are provided to support legacy applications in. Scripting with time in ServiceNow can keep you up at night. How to calculate difference between two dates in hours ServiceNow ?. 1 Log on to your training instance Use the application navigator and its filter to acces different areas of ServiceNow Add Knowledge and service catalog modules to favorites. daysAgo into a new GlideDateTime record and then obtain the display value of that new record. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. getUser () Returns a reference to the user object for the currently logged-in user. GlideSystem. Please check the example video and purchase only $7 $5 for this unique course to get more videos like this. Datepart is the parameter that specifies on which part of the date to return a new value (for example, year, month, day, hour, minute, and so forth), number is the value used to increment datepart, and date is. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. We would like to show you a description here but the site won’t allow us. Reply Delete. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. nowDateTime()); //Set the amount of time to add (in seconds) var timeToAdd = 86400; durToAdd = new GlideDuration ( timeToAdd *1000);We would like to show you a description here but the site won’t allow us. Impact Drive a faster ROI and amplify your expertise with ServiceNow Impact. We would like to show you a description here but the site won’t allow us. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. round(dur_seconds / 3600); // Math. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Please note: These APIs are provided to support legacy. We would like to show you a description here but the site won’t allow us. Please note: These APIs are provided to support legacy applications in. It is recommended that new. ere are some examples of how you could use a simple Javascript ‘split’ method to parse out the date and/or time value from a date/time field. The following sample functions allow you to easily get the minimum, maximum, average, and sum of values from a table field. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Though SN has a collection of date/time utilities, they are scant on formatting and calculation options. Support Manage your instances, access self-help, and getting technical support. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Please note: These APIs are provided to support legacy. Learning Build your skills with instructor-led and online training. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. getDisplayValue (), false); Open an existing Change Request record. So only in a business rule or script include, this cannot be used anywhere on the client side, unless you use a GlideAjax script. Please note: These APIs are provided to support legacy applications in. Members Online • CompSciMajor93. ServiceNow Learn more about ServiceNow products and solutions. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Everything here comes from developers and consultants like you!ServiceNow Snippets Table of Contents Template Snippet Title [Script Location] [Script Location] Snippets Verifying a record is found using GlideRecord. It is recommended that new. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Basically, to get a javascript date from a ServiceNow date field value do this: var date_number = getDateFromFormat ( g_form. scratchpad. getDisplayValue() everywhere. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Reject. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Thanks for sharing valuable information and very nice article. We would like to show you a description here but the site won’t allow us. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. We would like to show you a description here but the site won’t allow us. Neale 's excellent Xplore tool: (function () {. Please note: The APIs below are intended for scoped applications and may behave differently in the global scope. GlideSystem - Global. Please note: These APIs are provided to support legacy applications in. Please note: These APIs are provided to support legacy applications in the global scope. This method expects the earlier date as the first parameter and the later date as the second parameter; otherwise, the method returns the difference as a negative value. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Please note: These APIs are provided to support legacy applications in. ServiceNow User Groups (SNUGs) RiseUp with ServiceNow Forum. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Upload. opened_at. DateDiff(date1, date2) but it does not work in scoped applications. Search. updateIncidentAging(); function. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. . Please note: These APIs are provided to support legacy applications in the global scope. Store Download certified apps and integrations that complement ServiceNow. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Please note: These APIs are provided to support legacy applications in the global scope. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. dateDiff () method. Download the XML file above, and save it to your computer. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Please note: These APIs are provided to support legacy applications in. SN has. calDateDiff to calculate duration and business duration. , in a Client Script). Please note: These APIs are provided to support legacy applications in. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. We would like to show you a description here but the site won’t allow us. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. If you’re here as a reference and just need the key code snippets, here you go. OOB on update of a task record where the assignment_group field value changes, it increments by one. getEncodedQuery()); Returned: numberSTARTSWITHINC^stateIN1,2^sys_updated_on<=2018-06-08 06:59:59. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. For SQL Server I have some difficulty getting the difference between times. The OOB "Reassignment Count" is driven by a Business Rule on task named "reassignment counter". Function field. Please note: The APIs below are intended for scoped applications and. datediff | ServiceNowToday's Requirements:Normal change request , planned start date can't be. . Usage. setString (current. Create function fields and scripts in the Now Platform to perform common database transformations and calculations. Please note: These APIs are provided to support legacy applications in. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. dateDiff(metricInstance. start_date. Please note: The APIs below are intended for scoped applications and may behave differently in the global scope. RiseUp with ServiceNow Events. Loading. --. GlideSystem - Global. We will also talk about which settings and scripts we need to use. end_date. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Please note: These APIs are provided to support legacy applications in the global scope. daysAgo into a new GlideDateTime record and then obtain the display value of that new record. u_duration_1, gr. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. Please note: These APIs are provided to support legacy applications in. return gs. gs. My query is: var gr = new GlideRecord('task');. Community will be in read-only mode 8. GlideSystem - Global. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. It is recommended that new. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. I shall set my sites on the friend and close relative to GlideRecord, GlideAggregate. This method expects the earlier date as the first parameter and the later date as the second parameter; otherwise, the method returns the difference as a negative value. dateDiff(createdDate, today, true); // Calculate the number of days elapsed daysElapsed = daysElapsed/86400; You can test\debug code that uses current object in a background window simply by referencing a record sys_id this then allows you to log/print the results of your code (with a few small adjustments). This ajax function will allow you to send in two different glide date/time fields and return a calculation of their date/time difference in seconds, minutes, hours, or days. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. Documentation Find detailed info about ServiceNow products, apps, features, and releases. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. GlideSystem - calDateDiff (String startDate, String endDate, Boolean numericValue) - Product Documentation: Tokyo - Now Support Portal. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. Please note: These APIs are provided to support legacy applications in. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Learning Build your special with instructor-led and online training. ServiceNow provides no default logic for managing dates in applications. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Please note: These APIs are provided to support legacy applications in. . getDisplayValue(), current. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. gs. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Documentation Find detailed info about ServiceNow products, apps, features, and releases. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. When the duration field is calculated from date type fields using g_form. It is recommended that new. nowDateTime() or GlideDateTime. nil() Force a record into an update set Recursive function CatItem API CatCategory API CatalogSearch API Get Days Ago Working with GlideRecord. Please note: These APIs are provided to support legacy applications in. Please note: These APIs are provided to support legacy applications in. Bounce SSO - ServiceNowWhen creating Metrics, there are a few methods that are used with little to no documentation (at least that I can find). getRefRecord() Working with Dates. dateDiff. "domain" is an object, so you just need to check if you're on the "domain" property (using an if statement like you do for the cluster-members) and then within that, print the inner "name" property of that property. This method expects the earlier date as the first parameter and the later date as the second parameter; otherwise, the method returns the difference as a negative value. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Since 2009, ServiceNow Guru has been THE go-to source of ServiceNow technical content and knowledge for all ServiceNow. Follow the below process to create a delegated user functionality in service now :I needed to provide a way to calculate a ServiceNow catalog task SLA dynamically by the due dates set on individual catalog tasks. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. nowDateTime ()); After the script is run, the end_date field will hold the date and time of the moment. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Please note: These APIs are provided to support legacy applications in. Search for:WorkingCode contains hundreds of quality scripts and solutions that address REAL WORLD challenges. #servicenow #servicenowdeveloper GlideDateTime | Subtract | gs. Ensure the number of Days is negative (the Date Difference value should be negative). Please note: These APIs are provided to support legacy applications in. If selected, creates a field that displays the results of a database function, such as a mathematical operation, field length computation, or day of the week calculation. Checking for Events. Replies. Please note: These APIs are provided to support legacy applications in. Finally, we can add a summary row to the report that calculates the average turn around time. dateDiff (opened, closed, false); current. nowDateTime(),current. Anything farther in the future doesn't matter, as this will be in a report with a filter filtering down only the upcoming 60 days and all past due. Please note: These APIs are provided to support legacy applications in. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Pass gs. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Return Value. Bounce SSO - ServiceNowDATEADD (datepart, number, date) The DATEADD function returns a new datetime value based on adding an interval to the specified date. start. Bounce SSO - ServiceNowLet us know if you have seen any different or better uses of addDays (). Skip to page content. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. After all, programming around date/time has been a feature since the early days of digital computer systems. GlideSystem - Global. Skip to page content. dateDiff(create,start,true);} anotherWe would like to show you a description here but the site won’t allow us. dateDiff. To use the endOfNextYear () method in a scoped application, use the. Please note: The APIs below are intended for scoped applications and. Please note: These APIs are provided to support legacy applications in the global scope. var userObject = gs. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. closed_at); var duration = gs. It is recommended that new. dateDiff (closed, opened, true); duration. current. For example, instead of using: javascript:gs. Please note: These APIs are provided to support legacy applications in. It is recommended that new. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. GlideSystem - Global. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Problems can occur when using gs. Please note: These APIs are provided to support legacy applications in the global scope. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. We would like to show you a description here but the site won’t allow us. dateDiff takes two string of time in the user's format and returns the duration between them in a ddd hh:mm:ss format. ServiceNow LDAP, Groups, Roles ; Dell Latitude E6500 virtualization BIOS option; Dell T3600, Windows 8, UEFI,. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. var userObject = gs. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. Here is a quick server side script where you can get the duration difference, between 2 GlideDateTime objects. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. It is recommended that new. If OP decides to go down the customization path, this is where they'd make their changes; adding whatever additional checks and conditions their. Function fields have been introduced in Quebec release and help you generate the value based on computations of other fields and constants. Learning Build your competencies using instructor-led and online training. round() is optional and will round the number to the nearest integer gs. Please note: These APIs are provided to support legacy applications in. We would like to show you a description here but the site won’t allow us. Documentation Find elaborate info about ServiceNow our, apps, features, and reprieves. return gs. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. RiseUp with ServiceNow Blogs. GlideSystem - Global. Support Manage your instances,. Please note: These APIs are provided to support legacy applications in. print(gdt); This will return the following: 2023-01-04 01:37:50 It’s as simple as that, just a couple of. ServiceNow Learn show about ServiceNow products or answers. Module Recap Script an Event. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. datepart The units in which DATEDIFF reports the difference between the startdate and enddate. Releases and Upgrades. Please note: These APIs are provided to support legacy applications in the global scope. old durations';Schedule( schedRec. As of today, ServiceNow still uses gs. For example, instead of using: javascript:gs. GitHub Gist: instantly share code, notes, and snippets. RiseUp with ServiceNow Blogs. It is recommended that new. Please note: These APIs are provided to support legacy applications in. Unknown 30 July 2020 at 22:07. GlideSystem - Global. It is recommended that new. See Business rule mark_resolved and. getDisplayValue(), metricInstance. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. getDisplayValue gives me undefined when writing to the work log and makes my time difference negative in gs. Skip to page contentWe would like to show you a description here but the site won’t allow us. getDisplayValue(), false);. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. opened_at); var closed = new GlideDateTime (). dateDiff() method calculated the difference between two dates. 2 min read. current. GlideSystem - Global. It takes care of all timezones very well but still when you are doing scripting in. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. (current. nowDateTime(), true); var daysOld =. getDisplayValue (), false); Open an existing Change Request record (or create a new one) and put a Planned Start Date later than a Planned End Date. getDisplayValue (), current. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. setDisplayValue( gs. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. `var diff = gs. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. end_date. dateDiff (current. GlideSystem - Global. RiseUp with ServiceNow. 24 for scheduled maintenance (12a - 6a PST) Product Hubs. It is recommended that new. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. dateDiff (closed, opened, true); duration. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. The GMT in the format yyyy-mm-dd hh:mm:ss. This method expects the earlier date as the first parameter and the later date as the second parameter; otherwise, the method returns the difference as a negative value. scratchpad. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality.