GlideTime - Scoped
-
- UpdatedJan 30, 2025
- 4 minutes to read
- Yokohama
- API reference
The GlideTime API provides methods for performing operations on GlideTime objects, such as instantiating GlideTime objects or working with GlideTime fields.
For guidance on date time input strings with a list of common format conflicts, refer to Date and time format guidelines.
GlideTime - GlideTime()
Instantiates a GlideTime object with the current time.
Name | Type | Description |
---|---|---|
None |
Example
GlideTime - GlideTime(Number milliseconds)
Instantiates a GlideTime object with its time starting at midnight UTC plus the passed in value.
The value is adjusted for the timezone in which the instance resides. For example, if the user's instance is in a time zone that is -8 hours from the UTC, and 1000 is passed in, the time in the GlideTime object is 16:00:10 (00:00:00 - 8 hours +10 seconds.)
Name | Type | Description |
---|---|---|
milliseconds | Number | Time to add to midnight UTC. Unit: Milliseconds |
Example
This example shows adding 10 seconds to midnight (UTC), which is then adjusted for the time zone in which the instance resides. In this case, -8 hours from UTC.
Output:
GlideTime - getByFormat(String format)
Returns the time in the specified format.
For information on the time formats that you can pass into this method, see Global date and time field format. You can pass these values in any order and add separators such as a dash, space, backslash, or colon. In addition, you can also pass the character "a" to return am/pm.
Name | Type | Description |
---|---|---|
format | String | String to use to format the time. For example, if the current time is
10:30:20 then:
|
Type | Description |
---|---|
String | Time in the specified format. |
Example
GlideTime - getDisplayValue()
Gets the time in the current user's display format and time zone.
When designing business rules or script includes remember that this method may return values in different formats for different users.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The time in the user's format and time zone. |
Example
GlideTime - getDisplayValueInternal()
Gets the display value in the current user's time zone and the internal format (HH:mm:ss).
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The time value for the GlideTime object in the current user's time zone and the internal time format of HH:mm:ss. |
Example
GlideTime - getHourLocalTime()
Returns the hours part of the time using the local time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The hours using the local time zone. |
GlideTime - getHourOfDayLocalTime()
Returns the hours part of the time using the local time zone. The number of hours is based on a 24 hour clock.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The hours using the local time zone. The number of hours is based on a 24 hour clock. |
GlideTime - getHourOfDayUTC()
Returns the hours part of the time using the UTC time zone. The number of hours is based on a 24 hour clock.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The hours using the UTC time zone. The number of hours is based on a 24 hour clock. |
GlideTime - getHourUTC()
Returns the hours part of the time using the UTC time zone. The number of hours is based on a 12 hour clock. Noon and midnight are represented by 0, not 12.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The hours using the UTC time zone. The number of hours is based on a 12 hour clock. Noon and midnight are represented by 0, not 12. |
GlideTime - getMinutesLocalTime()
Returns the number of minutes using the local time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of minutes using the local time zone. |
GlideTime - getMinutesUTC()
Returns the number of minutes in the hour based on the UTC time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of minutes in the hour using the UTC time zone. |
GlideTime - getSeconds()
Returns the number of seconds in the current minute.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of seconds in the minute. |
GlideTime - getValue()
Gets the time value stored in the database by the GlideTime object in the internal format, HH:mm:ss, and the system time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The time value in the internal fomat and system time zone. |
Example
GlideTime - setDisplayValue(String asDisplayed)
Sets a time value using the current user's display format and time zone.
Name | Type | Description |
---|---|---|
asDisplayed | String | The time in the current user's display format and time zone. The parameter must be formatted using the current user's preferred display format, such as HH:mm:ss. |
Type | Description |
---|---|
None |
Example
GlideTime - setValue(String o)
Sets the time of the GlideTime object in the internal time zone.
Name | Type | Description |
---|---|---|
o | String | The time in hh:mm:ss format. |
Type | Description |
---|---|
None |
Example
GlideTime - subtract(GlideTime startTime, GlideTime endTime)
Gets the duration difference between two GlideTime object values.
Name | Type | Description |
---|---|---|
startTime | GlideTime | The start value. |
endTime | GlideTime | The end value. |
Type | Description |
---|---|
GlideDuration | The duration between the two values. |
Example
On this page
- GlideTime - GlideTime()
- GlideTime - GlideTime(Number milliseconds)
- GlideTime - getByFormat(String format)
- GlideTime - getDisplayValue()
- GlideTime - getDisplayValueInternal()
- GlideTime - getHourLocalTime()
- GlideTime - getHourOfDayLocalTime()
- GlideTime - getHourOfDayUTC()
- GlideTime - getHourUTC()
- GlideTime - getMinutesLocalTime()
- GlideTime - getMinutesUTC()
- GlideTime - getSeconds()
- GlideTime - getValue()
- GlideTime - setDisplayValue(String asDisplayed)
- GlideTime - setValue(String o)
- GlideTime - subtract(GlideTime startTime, GlideTime endTime)