gs.datediff servicenow. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. gs.datediff servicenow

 
 This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easiergs.datediff servicenow  Please note: The APIs below are intended for scoped applications and

Please note: These APIs are provided to support legacy applications in. GlideSystem - Global. To do this, click on the 'Add summary row' button and select the. current. The GlideDateTime constructor has a number of options: No-argument: Initializes to the current date/time GlideDateTime 1. 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. Reply Delete. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Please note: The APIs below are intended for scoped applications and. setString (current. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. u_duration_2, false); Works on the server (e. now(), current. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Neale 's excellent Xplore tool: (function () {. var cdt = g_form. Please note: These APIs are provided to support legacy applications in. Submit Search. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. 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. 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 provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Requirement 2: Mark changes as “Planned Date Overdue” if the duration of requirement 1 is greater 2 days. 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. getDisplayValue (), false); Open an existing Change Request record. dateDiff(current. 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. 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. Instead of storing data, a function fieldGlideSystem - Global. 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. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. , in a Client Script). Reply. They are really h. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. //calculate the age of this record var age = gs. 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. 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 reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. dateDiff (opened, closed, false); current. Please note: These APIs are provided to support legacy applications in. Reject. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. Please note: These APIs are provided to support legacy applications in. 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. 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. 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. r/servicenow. Bounce SSO - ServiceNowDATEADD (datepart, number, date) The DATEADD function returns a new datetime value based on adding an interval to the specified date. Example scenario: Open any Change. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Regular fields store a value in the database. Parent topic: Server-side scripting GlideAggregate The GlideAggregate class is an extension of GlideRecord and allows database aggregation (COUNT, SUM, MIN,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. An optional parameter, saved with the instance if specified. To use the endOfNextYear () method in a scoped application, use the corresponding scoped method: Scoped GlideSystem - endOfNextYear (). It can be tricky, difficult to get things to work, and there doesn’t seem to be great documentation on things related to time. Checking for Events. This article is providing the way to calculate the duration of days by using Scheduler function in Script. Reply Delete. Why is it rounding to the full number of days?. dateDiff(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. , in a Client Script). We would like to show you a description here but the site won’t allow us. We will learn how to develop scripts in ServiceNow with numerous real-time problems and solutions in this series. 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. GlideAggregate is an extension of GlideRecord. 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. It is recommended that new. Replies. 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. Do not use gs. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. An event queue to add the event to. It is recommended that new. Please note: These APIs are provided to support legacy applications in. Community will be in read-only mode 8. u_duration_1, gr. ServiceNow Learn show about ServiceNow products or answers. GlideSystem - Global. gs. var userObject = gs. nowDateTime() or GlideDateTime. Please note: These APIs are provided to support legacy applications 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. getValue('the_date_field'), g_user_date_format); var my_date = new Date( date_number); Or, from a Date/Time. getDaysInMonthLocalTime ()); GlideDateTime - Scoped. 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. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Leave a Reply Cancel reply. Returns the date and time for the end of next year in GMT. start_date. 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 | ServiceNowToday's Requirements:Normal change request , planned start. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. dateDiff(createdDate, today, true); // Calculate the number of days elapsed daysElapsed = daysElapsed/86400; You can testdebug 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). Es una guia en ingles de la plataforma de serviceNow, para efectuar direfentes scripts dentro de la misma plataforma. The script below finds all records on the task table with a due date between 24 hours from now and 24 hours and 15 minutes from now. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. This Script is in Metric Definitions to create and update Metric InstancesStep 1: Register the Event. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. getDisplayValueInternal(),false);} How do I use GlideAjax Servicenow? Create a GlideAjax instance by calling the GlideAjax constructor. due_date,true);. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. It is recommended that new. So what you can do is actually put the code right in the Scheduled Job itself and forget about the Script Include and you can run it as a Background Script or in James. RiseUp with ServiceNow Forum. 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. The day you realize of this. 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. getSession(). ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. GlideSystem - Global. 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. 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. ServiceNow Learn more about ServiceNow products and solutions. ServiceNow Search Guide ServiceNow Search Guide; Index Fundamentals Fundamentals Labs Lab 1. Please note: These APIs are provided to support legacy applications in. g. 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. GlideSystem - Global. Commit the update set. For example, instead of using: javascript:gs. Create function fields and scripts in the Now Platform to perform common database transformations and calculations. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Here's an example script: var opened = new GlideDateTime (). Skip to page contentWe would like to show you a description here but the site won’t allow us. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. . As of today, ServiceNow still uses gs. dateDiff. Categories Top Downloads. 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. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Requirement 4:Version: Paris#ServiceNowのDate, Date/Time型ServiceNowのDate/Time型ではDB内でUTC(GMT)のUNIXTIME(エポック秒)でミリ秒…When setting a variable in a workflow script to the current date and time, use the setDisplayValue method. Please note: These APIs are provided to support legacy applications 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. 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. Please note: These APIs are provided to support legacy applications in. var daysElapsed = gs. RiseUp with ServiceNow Events. setDisplayValue( 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 Knowledge11 Advanced Scripting & Debugging Lab - Download as a PDF or view online for free. daysAgo(-5); as a default value, use the following: javascript:var diff = gs. getDisplayValue(); and removing the . dateDiff () does not show the day value if negative - Known Error - Now Support Portal Loading. Unexpected Results from GlideAggregate By default, the GlideAggregate functionWe would like to show you a description here but the site won’t allow us. It is recommended that new. dateDiff () with GlideDateTime objects. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Finally, we can add a summary row to the report that calculates the average turn around time. 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. RiseUp with ServiceNow Blogs. start. getRefRecord() Working with Dates. getValue (‘due_date’); //first Date/Time field. Please note: These APIs are provided to support legacy applications in. Please note: These APIs are provided to support legacy applications in. Documentation Find detailed info about ServiceNow products, apps, features, and releases. For example, instead of using: javascript:gs. See the GlideDateTime API reference for a complete list of methods. Please note: These APIs are provided to support legacy applications in. getTimeDiff(); function getTimeDiff(){var startDate =. Navigate to System Update Sets -> Retrieved Update Sets. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. The OOB "Reassignment Count" is driven by a Business Rule on task named "reassignment counter". ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. 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. It is recommended that new. Please note: These APIs are provided to support legacy applications in. dateDiff () ,the day value is not shown Steps to Reproduce Example scenario: Open any Change Request record. 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. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. The sample script calculates the difference between the Post Incident Review (pir) date/time value identified in the record and activity's start date/time. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. EventQueue. 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. u_resolved. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. 3. nowDateTime(), true); var daysOld =. GlideSystem - Global. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. GlideSystem - Global. This article will be at a reasonably advanced level but should be valuable for most any level of ServiceNow developer. GlideSystem - Global. Please note: These APIs are provided to support legacy applications in. This made it simpler, rather than having to do more processing on the client side, just evaluate true/false. GlideSystem - Global. Please note: These APIs are provided to support legacy applications in. 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. nowDateTime () or GlideDateTime. Skip to page contentWe would like to show you a description here but the site won’t allow us. The datepart value cannot be specified in a variable, nor as a quoted string like 'month'. Pass gs. 24 for scheduled maintenance (12a - 6a PST) Product Hubs. Please note: These APIs are provided to support legacy applications in. Though SN has a collection of date/time utilities, they are scant on formatting and calculation options. 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. dateDiff () (Global GlideSystem) returns invalid results - Support and Troubleshooting - Now Support Portal Loading. GlideSystem - Global. Please note: The APIs below are intended for scoped applications and may behave differently in the global scope. 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(), gr. Returns the date and time for the end of next year in GMT. 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. There are two ServiceNow classes: GlideDate and GlideDateTime, that contain methods which are useful for date comparison such as: Equals. Bounce SSO - ServiceNowDATEADD (datepart, number, date) The DATEADD function returns a new datetime value based on adding an interval to the specified date. 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. Please note: These APIs are provided to support legacy applications in. 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. business_duration = gs. closed_at); var duration = gs. r/servicenow. Special characters like underscores (_) are removed. Module Recap Script an Event. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. addDays() will addDays to the time, but does not return a glideDateTime. Please note: These APIs are provided to support legacy applications in. nowDateTime ()); After the script is run, the end_date field will hold the date and time of the moment. dateDiff (String startDate, String endDate, Boolean numericValue) Calculates the difference between two dates. getEncodedQuery()); Returned: numberSTARTSWITHINC^stateIN1,2^sys_updated_on<=2018-06-08 06:59:59. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. u_duration_3 = gs. We would like to show you a description here but the site won’t allow us. dateDiff(firstDay, lastDay, true) < 0)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_time, scheduled_time, true); // calculate the difference between scheduled retirement and current date` `var. GlideSystem - Global. Please note: These APIs are provided to support legacy applications in. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. The most relevant topics (based on weighting and matching. 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. Thanks for sharing valuable information and very nice article. However, these classes are only available in the server side of ServiceNow but unavailable in the client size. var dif = gs. dateDiff () (Global GlideSystem) returns invalid results - Support and Troubleshooting - Now Support Portal Loading. Please note: These APIs are provided to support legacy applications in the global scope. If you want to know exactly what is and is not in callable in scope, it is all in the API documentation. Ensure the number of Days is negative (the Date Difference value should be negative). 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. Please note: These APIs are provided to support legacy applications in. Removing the . getDisplayValue(), true) < 0We would like to show you a description here but the site won’t allow us. end_date. 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. Warning. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. //Can be added to script include to return records more than X minutes as OOB you can compare hour, days etc. 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. 57K views 3 years ago. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. March 26, 2019 Catalog Item: Request to Change your profile picture in Servicenow. Bounce SSO - ServiceNowWhen creating Metrics, there are a few methods that are used with little to no documentation (at least that I can find). . ServiceNow provides APIs for the Glide Server. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. u_duration = gs. start_date. dateDiff( gr. Use the GlideDateTime methods to perform date-time operations, such as instantiating a GlideDateTime object, performing date-time calculations, formatting a date-time, or converting between date-time formats. Do not use gs. It is recommended that new. Please note: These APIs are provided to support legacy applications in. Problems can occur when using gs. , in a Business Rule), not on the client (e. print(gr. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. getDisplayValue(), false);. What is GlideAggregate Earlier this year, the blog visited the topic of GlideRecord. Since 2009, ServiceNow Guru has been THE go-to source of ServiceNow technical content and knowledge for all ServiceNow. ServiceNow Tutorial. ServiceNow Snippets. Function definition. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. Impact Drive a faster ROI and amplify your expertise with ServiceNow Impact. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. When the duration field is calculated from date type fields using g_form. The GMT in the format yyyy-mm-dd hh:mm:ss. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. To use the endOfNextYear () method in a scoped application, use the. getDisplayValue (), current. Please note: These APIs are provided to support legacy applications in. If the PIR meeting is scheduled on the first day of the week, the timer will remove 3 days from the difference, else it will remove one day from the difference. closed_at); var duration = gs. 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 (or create a new one) and put a Planned Start Date later than a Planned End Date. With Scheduler, it is easy to calculate the duration with some option, like exclude week-end orServiceNow 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. Please note: These APIs are provided to support legacy applications in the global scope. Best Practices Script an Event. 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. Please note: These APIs are provided to support legacy applications in the global scope. Function field. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Function fields have been introduced in Quebec release and help you generate the value based on computations of other fields and constants. GlideRecord To start the new year, I want to dive into the depths of the GlideRecord object and how this information can make you a better developer. var elapsedTime = 0; var aging = '';ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. The script below finds all records on the task table with a due date between 24 hours from now and 24 hours and 15 minutes from now. GlideSystem - Global. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality. DateDiff (date1, date2) but it does not work in scoped applications. dateDiff(startDate. This reference lists available classes and methods along with parameters, descriptions, and examples to make extending the ServiceNow platform easier. Unknown 30 July 2020 at 22:07. // Duration in hours var dur_seconds = gs. 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. ServiceNow provides JavaScript APIs for use within scripts running on the ServiceNow platform to deliver common functionality.