CAD · Question #226
Which server-side object provides methods for working with dates when writing a script in a privately scoped application?
The correct answer is A. GlideDate Time. The GlideDateTime object is used in server-side scripts, including those in privately scoped applications, to perform various operations and manipulations with dates and times.
Question
Which server-side object provides methods for working with dates when writing a script in a privately scoped application?
Options
- AGlideDate Time
- Bcurrent
- CGlideRecord
- DGlideSystem
How the community answered
(47 responses)- A89% (42)
- B6% (3)
- C2% (1)
- D2% (1)
Why each option
The `GlideDateTime` object is used in server-side scripts, including those in privately scoped applications, to perform various operations and manipulations with dates and times.
The `GlideDateTime` object is the primary server-side API for handling date and time values in ServiceNow, offering methods for creating, comparing, and formatting date/time objects, including awareness of time zones and durations. It provides comprehensive functionality for date calculations and conversions.
`current` is a GlideRecord object representing the current record being processed, not a date/time utility.
`GlideRecord` is used to query, insert, update, and delete records in the database, not for date/time manipulation.
`GlideSystem` (gs) provides various utility methods, including some for logging and session information, but `GlideDateTime` is the specific object for date/time operations.
Concept tested: Server-side date/time object
Source: https://docs.servicenow.com/bundle/utah-application-development/page/app-store/dev_portal/API_reference/GlideDateTime/concept/GlideDateTimeAPI.html
Topics
Community Discussion
No community discussion yet for this question.