GlideDateTime - Scoped
-
- UpdatedJan 30, 2025
- 20 minutes to read
- Yokohama
- API reference
The scoped GlideDateTime class provides methods for performing operations on GlideDateTime objects.
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.
For guidance on date time input strings with a list of common format conflicts, refer to Date and time format guidelines.
Scoped GlideDateTime - GlideDateTime()
Instantiates a new GlideDateTime object with the current date and time.
Name | Type | Description |
---|---|---|
None |
Example
This example instantiates a GlideDateTime object.
Output:
Scoped GlideDateTime - GlideDateTime(String value)
Instantiates a new GlideDateTime object using the passed-in date and time value.
- yyyy-MM-dd HH:mm:ss
- MM/dd/yyyy HH:mm:ss
- MM-dd-yyyy HH:mm:ss
- MM-dd-yyyy HH:mm
- MM-dd-yyyy
- MM/dd/yyyy
- dd-MM-yyyy HH:mm:ss
- dd-MM-yyyy HH.mm.ss
- dd-MM-yyyy HH.mm
- dd-MM-yy HH.mm.ss
- dd/MM/yyyy
- dd-MM-yyyy
- yyyy-MM-dd HH:mm
- yyyy-MM-dd
- dd.MM.yyyy HH:mm:ss
- dd.MM.yyyy HH.mm.ss
- dd.MM.yyyy hh:mm:ss a
- dd.MM.yyyy hh.mm.ss a
- dd.MM.yyyy
- yyyy-MM-dd'T'HH:mm:ss.SSSZ
Name | Type | Description |
---|---|---|
value | String | UTC date and time to set in the GlideDateTime object. |
Example
This example shows how to instantiate a GlideDateTime object using a string.
Output:
Scoped GlideDateTime - GlideDateTime(GlideDateTime g)
Instantiates a new GlideDateTime object set to the time of a specified GlideDateTime object.
Name | Type | Description |
---|---|---|
g | GlideDateTime | Object used to set the time of the new object. |
Example
This example shows how to instantiate a GlideDateTime object (gdt1) using a string in the format yyyy-MM-dd HH:mm:ss
, and a second GlideDateTime object (gdt2) using
gdt1.
Output:
Scoped GlideDateTime - add(GlideTime gd)
Adds a GlideTime object to the current GlideDateTime object.
Name | Type | Description |
---|---|---|
gd | GlideTime | GlideTime object whose time value to add to the specified GlideDateTime object. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - add(Number milliseconds)
Adds the specified number of milliseconds to the current GlideDateTime object.
Name | Type | Description |
---|---|---|
milliseconds | Number | The number of milliseconds to add. |
Type | Description |
---|---|
None |
Example
Scoped GlideDateTime - addDaysLocalTime(Number days)
Adds a specified number of days to the current GlideDateTime object. A negative parameter subtracts days. The method determines the local date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts days using the local date and time values.
Name | Type | Description |
---|---|---|
days | Number | The number of days to add. Use a negative value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addDaysUTC(Number days)
Adds a specified number of days to the current GlideDateTime object. A negative parameter subtracts days. The method determines the UTC date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts days using the UTC date and time values.
Name | Type | Description |
---|---|---|
days | Number | The number of days to add. Use a negative number to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addMonthsLocalTime(Number months)
Adds a specified number of months to the current GlideDateTime object. A negative parameter subtracts months. The method determines the local date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts months using the local date and time values.
Name | Type | Description |
---|---|---|
months | Number | The number of months to add. use a negative value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addMonthsUTC(Number months)
Adds a specified number of months to the current GlideDateTime object. A negative parameter subtracts months. The method determines the UTC date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts months using the UTC date and time values.
Name | Type | Description |
---|---|---|
months | Number | The number of months to add. Use a negative value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addSeconds(Number seconds)
Adds the specified number of seconds to the current GlideDateTime object.
Name | Type | Description |
---|---|---|
seconds | Number | The number of seconds to add. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addWeeksLocalTime(Number weeks)
Adds a specified number of weeks to the current GlideDateTime object. A negative parameter subtracts weeks. The method determines the local date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts weeks using the local date and time values.
Name | Type | Description |
---|---|---|
weeks | Number | The number of weeks to add. Use a negative value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addWeeksUTC(Number weeks)
Adds a specified number of weeks to the current GlideDateTime object. A negative parameter subtracts weeks. The method determines the UTC date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts weeks using the UTC date and time values.
Name | Type | Description |
---|---|---|
weeks | Number | The number of weeks to add. Use a negative value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addYearsLocalTime(Number years)
Adds a specified number of years to the current GlideDateTime object. A negative parameter subtracts years. The method determines the local date and time equivalent to the value stored by the GlideDateTime object, then adds or subtracts years using the local date and time values.
Name | Type | Description |
---|---|---|
years | Number | The number of years to add. Use a negative value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - addYearsUTC(Number years)
Adds a specified number of years to the current GlideDateTime object. A negative parameter subtracts years. The date and time value stored by GlideDateTime object is interpreted as being in the UTC time zone.
Name | Type | Description |
---|---|---|
years | Number | The number of years to add. Use a negative value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - after(GlideDateTime gdt)
Determines if the GlideDateTime object's date and time occurs after the specified object's date and time.
Name | Type | Description |
---|---|---|
gdt | GlideDateTime | Date and time to check against. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the GlideDateTime object's date and time is after
the date and time specified by the parameter. Possible values:
|
Example
Output:
Scoped GlideDateTime - before(GlideDateTime gdt)
Determines if the GlideDateTime object's date and time occurs before the specified GlideDateTime object's date and time.
Name | Type | Description |
---|---|---|
gdt | GlideDateTime | Date and time to check against. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the GlideDateTime object's date and time is before
the date and time specified by the parameter. Possible values:
|
Example
Output
Scoped GlideDateTime - compareTo(Object o)
Compares two date and time objects to determine whether they are equivalent or one occurs before or after the other.
Name | Type | Description |
---|---|---|
o | Object | Date and time object in GlideDateTime format |
Type | Description |
---|---|
Number |
|
Example
Output:
Scoped GlideDateTime - equals(Object dateTime)
Compares a datetime with an existing value for equality.
Name | Type | Description |
---|---|---|
dateTime | GlideDateTime object or String | The datetime to compare. |
Type | Description |
---|---|
Boolean | Returns true if they are equal; otherwise, false. |
Example
Output:
Scoped GlideDateTime - getDate()
Returns the date stored by the GlideDateTime object. Expressed in the standard format, yyyy-MM-dd, and in the system time zone, GMT by default.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | Date in the system time zone. |
Example
Output:
Scoped GlideDateTime - getDayOfMonthLocalTime()
Gets the day of the month stored by the GlideDateTime object, expressed in the current user's time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The day of the month in the user's time zone, from 1 to 31. |
Example
Output:
Scoped GlideDateTime - getDayOfMonthUTC()
Gets the day of the month stored by the GlideDateTime object, expressed in the UTC time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The day of the month in the UTC time zone, from 1 to 31. |
Example
Output:
Scoped GlideDateTime - getDayOfWeekLocalTime()
Gets the day of the week stored by the GlideDateTime object, expressed in the user's time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The day of week value, in the user's time zone, from 1 to 7. Monday equals 1, Sunday equals 7. |
Example
Output:
Scoped GlideDateTime - getDayOfWeekUTC()
Returns the day of the week stored by the GlideDateTime object, expressed in the UTC time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Day of week value from 1 to 7. Monday equals 1, Sunday equals 7. |
Example
Output:
Scoped GlideDateTime - getDaysInMonthLocalTime()
Gets the number of days in the month stored by the GlideDateTime object, expressed in the current user's time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of days in the current month in the user's time zone. |
Example
Output:
Scoped GlideDateTime - getDaysInMonthUTC()
Gets the number of days in the month stored by the GlideDateTime object, expressed in the UTC time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of days in the month stored by the GlideDateTime object, expressed in the UTC time zone. |
Example
Output:
Scoped GlideDateTime - getDisplayValue()
Gets the date and time value in the current user's display format and time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Date and time in the user's format and time zone. Keep in mind when designing business rules or script includes that this method may return values in different formats for different users. |
Example
Output:
Scoped GlideDateTime - getDisplayValueInternal()
Gets the display value in the internal format (yyyy-MM-dd HH:mm:ss).
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The date and time values for the GlideDateTime object in the current user's
time zone and the internal date and time format of yyyy-MM-dd
HH:mm:ss . |
Example
Output:
Scoped GlideDateTime - getDisplayValueLang(String style, String language)
Returns a date and time value in the current users' locale according to a specified language and date style.
Name | Type | Description |
---|---|---|
style | String | Specifies the date and time format. Valid values:
If any other value is passed the API will default to use medium. Accepted values are not case sensitive. |
language | String | Returns the date according to a specified language value. Accepts language tags
that conform with the BCP-47 standard. For example, fr for French
or en-UK for British English. For a full list of accepted values,
see BCP 47 Language Code List. |
Type | Description |
---|---|
String | A string representation of the date in the style specified and in the appropriate format for the locale of the current user. |
Example
The following example returns the date and time of the user's locale in all language and date styles.
Output:
Scoped GlideDateTime - getDSTOffset()
Gets the amount of time that daylight saving time is offset.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Amount of time, in milliseconds, that daylight saving is offset. Returns 0 if there is no offset or if the time is not during daylight saving time. |
Example
Output:
Scoped GlideDateTime - getErrorMsg()
Gets the current error message.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | The error message. |
Example
Output:
Scoped GlideDateTime - getInternalFormattedLocalTime()
Returns the object's time in the local time zone and in the internal format.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The object's time in the local time zone and the internal format. |
Example
This example displays the time in the system time format of the user's timezone.
Output
Scoped GlideDateTime - getLocalDate()
Gets the date stored by the GlideDateTime object, expressed in the standard format, yyyy-MM-dd, and the current user's time zone.
Name | Type | Description |
---|---|---|
None |
Type | |
---|---|
GlideDate | The date in the user's time zone. |
Example
Output:
Scoped GlideDateTime - getLocalTime()
Returns a GlideTime object that represents the time portion of the GlideDateTime object in the user's time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
GlideTime | The time in the user's time zone. |
Example
Output:
Scoped GlideDateTime - getMonthLocalTime()
Gets the month stored by the GlideDateTime object, expressed in the current user's time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The numerical value of the month. |
Example
Output:
Scoped GlideDateTime - getMonthUTC()
Gets the month stored by the GlideDateTime object, expressed in the UTC time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The numerical value of the month. |
Example
Output:
Scoped GlideDateTime - getNumericValue()
Gets the number of milliseconds since January 1, 1970, 00:00:00 GMT.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of milliseconds since January 1, 1970, 00:00:00 GMT. |
Example
Output:
Scoped GlideDateTime - getTime()
Returns a GlideTime object that represents the time portion of the GlideDateTime object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
GlideTime | The Unix duration stamp in system format based on GMT time. |
Example
Output:
Scoped GlideDateTime - getTZOffset()
Gets the time zone offset in milliseconds.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of milliseconds of time zone offset. |
Example
Output:
Scoped GlideDateTime - getUserFormattedLocalTime()
Returns the object's time in the local time zone and in the user's format.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The object's time in the local time zone and in the user's format. |
Example
This example shows the object's time in the local time zone.
Output:
Scoped GlideDateTime - getValue()
Returns the date and time value stored by the GlideDateTime object in the internal format, yyyy-MM-dd HH:mm:ss, in the UTC time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Date and time in the internal format and system time zone. Format: yyyy-MM-dd HH:mm:ss in the UTC time zone. |
Example
Output:
Scoped GlideDateTime - getWeekOfYearLocalTime()
Gets the number of the week stored by the GlideDateTime object, expressed in the current user's time zone.
All weeks begin on Sunday. The first week of the year is the week that contains at least one day of the new year. The week beginning Sunday 2015-12-27 is considered the first week of 2016 as that week contains January 1 and 2.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of the current week. The highest week number in a year is either 52 or 53. |
Example
Output:
Scoped GlideDateTime - getWeekOfYearUTC()
Gets the number of the week stored by the GlideDateTime object, expressed in the UTC time zone.
All weeks begin on Sunday. The first week of the year is the week that contains at least one day of the new year. The week beginning Sunday 2015-12-27 is considered the first week of 2016 as that week contains January 1 and 2.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The number of the current week in UTC time. The highest week number in a year is either 52 or 53. |
Example
Output:
Scoped GlideDateTime - getYearLocalTime()
Gets the year stored by the GlideDateTime object, expressed in the current user's time zone.
Name | Type | Description |
---|---|---|
none |
Type | Description |
---|---|
Number | Four-digit year value in the user's time zone. |
Example
Output:
Scoped GlideDateTime - getYearUTC()
Gets the year stored by the GlideDateTime object, expressed in the UTC time zone.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | 4-digit year value in the UTC time zone. |
Example
Output:
Scoped GlideDateTime - hasDate()
Determines if an object's date is set.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | True if the object date is set; otherwise, returns false. |
Example
Output:
Scoped GlideDateTime - isDST()
Determines if an object's time uses a daylight saving offset.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | True if the time is daylight saving; otherwise, returns false. |
Example
Output:
Scoped GlideDateTime - isValid()
Determines if a value is a valid date and time.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | True if value is valid; otherwise, returns false. |
Example
Output:
Scoped GlideDateTime - onOrAfter(GlideDateTime gdt)
Determines if the GlideDateTime object's data and time occurs on or after the specified GlideDateTime object's date and time.
Name | Type | Description |
---|---|---|
gdt | GlideDateTime | Date and time to check against. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the GlideDateTime object's date and time is on or
after the date and time specified by the parameter. Possible values:
|
Example
Output
Scoped GlideDateTime - onOrBefore(GlideDateTime gdt)
Determines if the GlideDateTime object's data and time occurs on or before the specified GlideDateTime object's date and time.
Name | Type | Description |
---|---|---|
gdt | GlideDateTime | Date and time to check against. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the GlideDateTime object's date and time is on or
before the date and time specified by the parameter. Possible values:
|
Example
Output
Scoped GlideDateTime - setDayOfMonthLocalTime(Number day)
Sets the day of the month to a specified value in the current user's time zone.
Name | Type | Description |
---|---|---|
day | Number | The day of month to change to, from 1 to 31. If this value is greater than the maximum number of days in the month, the value is set to the last day of the month. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setDayOfMonthUTC(Number day)
Sets the day of the month to a specified value in the UTC time zone.
Name | Type | Description |
---|---|---|
day | Number | The day of month to change to, from 1 to 31. If this value is greater than the maximum number of days in the month, the value is set to the last day of the month. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setDisplayValue(String asDisplayed)
Sets a date and time value using the current user's display format and time zone.
Name | Type | Description |
---|---|---|
asDisplayed | String | The date and 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 MM-dd-yyyy HH:mm:ss. To assign the current date and time to a variable in a
workflow script, use
variable
.setDisplayValue(gs.nowDateTime); . |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setDisplayValue(String value, String format)
Sets a date and time value using the current user's time zone and the specified date and time format.
This method throws a runtime exception if the date and time format used in the value parameter does not match the format parameter. You can retrieve the error message by calling getErrorMsg() on the GlideDateTime object after the exception is caught.
Name | Type | Description |
---|---|---|
value | String | Date and time in the current user's time zone. |
format | String | Date and time format to use to parse the value parameter.
Use the following values to describe the value
parameter:
For example: "dd-MM-yyyy HH:mm:ss" or "MM-dd-yyyy HH:mm". |
Type | Description |
---|---|
None |
Example
Output
Scoped GlideDateTime - setDisplayValueInternal(String value)
Sets a date and time value using the internal format (yyyy-MM-dd HH:mm:ss) and the current user's time zone.
Name | Type | Description |
---|---|---|
value | String | The date and time in internal format. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setDisplayValueLang(String dateTime, String style)
Sets a date and time using a specified style and format according to the current user's locale.
Name | Type | Description |
---|---|---|
dateTime | String | Date and time value for the GlideDate object in the current user's time zone.
Valid values are any date and time output from the
getDisplayValueLang() function. For instance, using output from the getDisplayValueLang(String style, String language) example earlier in this topic, November 28, 2022 07:03:41 or 28.11.2022 07:03:41 are accepted values. |
style | String | Specifies the date format. Valid values:
If any other value is passed the API will default to use medium. Accepted values are not case sensitive. |
Type | Description |
---|---|
Void |
Example
The following example returns the date and time in short and full styles.
Output:
Scoped GlideDateTime - setDisplayValueLang(String dateTime, String style, String language)
Sets a date and time using a specified style, language, and format according to the current user's locale.
Name | Type | Description |
---|---|---|
dateTime | String | Date and time value for the GlideDate object in the current user's time zone.
Valid values are any date and time output from the
getDisplayValueLang() function. For instance, using output from the getDisplayValueLang(String style, String language) example earlier in this topic, November 28, 2022 07:03:41 or 28.11.2022 07:03:41 are accepted values. |
style | String | Specifies the date format. Valid values:
If any other value is passed the API will default to use medium. Accepted values are not case sensitive. |
language | String | Sets the language using a language tag that conforms with the BCP-47 standard.
For example, fr for French or en-UK for British
English. For a full list of accepted values, see BCP 47 Language Code List. |
Type | Description |
---|---|
Void |
Example
The following example returns the date and time in short and full styles for English and French.
Output:
Scoped GlideDateTime - setGlideDateTime(GlideDateTime g)
Sets the date and time of the current object using an existing GlideDateTime object. This method is equivalent to instantiating a new object with a GlideDateTime parameter.
Name | Type | Description |
---|---|---|
g | GlideDateTime | The object to use for setting the datetime value. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setMonthLocalTime(Number month)
Sets the month stored by the GlideDateTime object to the specified value using the current user's time zone.
Name | Type | Description |
---|---|---|
month | Number | The month to change to. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setMonthUTC(Number month)
Sets the month stored by the GlideDateTime object to the specified value using the UTC time zone.
Name | Type | Description |
---|---|---|
month | Number | The month to change to. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setValue(String o)
Sets the date and time of the GlideDateTime object.
Name | Type | Description |
---|---|---|
o | String | The date and time to use. This parameter may be one of several types:
|
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setValueUTC(String dt, String format)
Sets a date and time value using the UTC time zone and the specified date and time
format. This method throws a runtime exception if the date and time format used in the
dt parameter does not match the format parameter.
You can retrieve the error message by calling getErrorMsg()
on the
GlideDateTime object after the exception is caught.
Name | Type | Description |
---|---|---|
dt | String | The date and time to use. |
format | String | The date and time format to use. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setYearLocalTime(Number year)
Sets the year stored by the GlideDateTime object to the specified value using the current user's time zone.
Name | Type | Description |
---|---|---|
year | Number | The year to change to. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - setYearUTC(Number year)
Sets the year stored by the GlideDateTime object to the specified value using the UTC time zone.
Name | Type | Description |
---|---|---|
year | Number | The year to change to. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - subtract(GlideTime time)
Subtracts a specified amount of time from the current GlideDateTime object.
Name | Type | Description |
---|---|---|
time | GlideTime | The time value to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - subtract(Number milliseconds)
Subtracts the specified number of milliseconds from the GlideDateTime object.
Name | Type | Description |
---|---|---|
milliseconds | Number | Number of milliseconds to subtract. |
Type | Description |
---|---|
None |
Example
Output:
Scoped GlideDateTime - subtract(GlideDateTime start, GlideDateTime end)
Returns the duration difference between two specified GlideDateTime objects.
Name | Type | Description |
---|---|---|
Start | GlideDateTime | Start date object. |
End | GlideDateTime | End date object. |
Type | Description |
---|---|
GlideDuration | Duration difference between the two specified dates. |
Example
Output:
Scoped GlideDateTime - toString()
Gets the date and time value stored by the GlideDateTime object in the internal format, yyyy-MM-dd HH:mm:ss, and the system time zone, UTC by default. This method is equivalent to getValue().
Name | Type | Description |
---|---|---|
None |
Type | |
---|---|
String | The date and time stored by the GlideDateTime object in the system time zone and format. |
Example
Output:
On this page
- Scoped GlideDateTime - GlideDateTime()
- Scoped GlideDateTime - GlideDateTime(String value)
- Scoped GlideDateTime - GlideDateTime(GlideDateTime g)
- Scoped GlideDateTime - add(GlideTime gd)
- Scoped GlideDateTime - add(Number milliseconds)
- Scoped GlideDateTime - addDaysLocalTime(Number days)
- Scoped GlideDateTime - addDaysUTC(Number days)
- Scoped GlideDateTime - addMonthsLocalTime(Number months)
- Scoped GlideDateTime - addMonthsUTC(Number months)
- Scoped GlideDateTime - addSeconds(Number seconds)
- Scoped GlideDateTime - addWeeksLocalTime(Number weeks)
- Scoped GlideDateTime - addWeeksUTC(Number weeks)
- Scoped GlideDateTime - addYearsLocalTime(Number years)
- Scoped GlideDateTime - addYearsUTC(Number years)
- Scoped GlideDateTime - after(GlideDateTime gdt)
- Scoped GlideDateTime - before(GlideDateTime gdt)
- Scoped GlideDateTime - compareTo(Object o)
- Scoped GlideDateTime - equals(Object dateTime)
- Scoped GlideDateTime - getDate()
- Scoped GlideDateTime - getDayOfMonthLocalTime()
- Scoped GlideDateTime - getDayOfMonthUTC()
- Scoped GlideDateTime - getDayOfWeekLocalTime()
- Scoped GlideDateTime - getDayOfWeekUTC()
- Scoped GlideDateTime - getDaysInMonthLocalTime()
- Scoped GlideDateTime - getDaysInMonthUTC()
- Scoped GlideDateTime - getDisplayValue()
- Scoped GlideDateTime - getDisplayValueInternal()
- Scoped GlideDateTime - getDisplayValueLang(String style, String language)
- Scoped GlideDateTime - getDSTOffset()
- Scoped GlideDateTime - getErrorMsg()
- Scoped GlideDateTime - getInternalFormattedLocalTime()
- Scoped GlideDateTime - getLocalDate()
- Scoped GlideDateTime - getLocalTime()
- Scoped GlideDateTime - getMonthLocalTime()
- Scoped GlideDateTime - getMonthUTC()
- Scoped GlideDateTime - getNumericValue()
- Scoped GlideDateTime - getTime()
- Scoped GlideDateTime - getTZOffset()
- Scoped GlideDateTime - getUserFormattedLocalTime()
- Scoped GlideDateTime - getValue()
- Scoped GlideDateTime - getWeekOfYearLocalTime()
- Scoped GlideDateTime - getWeekOfYearUTC()
- Scoped GlideDateTime - getYearLocalTime()
- Scoped GlideDateTime - getYearUTC()
- Scoped GlideDateTime - hasDate()
- Scoped GlideDateTime - isDST()
- Scoped GlideDateTime - isValid()
- Scoped GlideDateTime - onOrAfter(GlideDateTime gdt)
- Scoped GlideDateTime - onOrBefore(GlideDateTime gdt)
- Scoped GlideDateTime - setDayOfMonthLocalTime(Number day)
- Scoped GlideDateTime - setDayOfMonthUTC(Number day)
- Scoped GlideDateTime - setDisplayValue(String asDisplayed)
- Scoped GlideDateTime - setDisplayValue(String value, String format)
- Scoped GlideDateTime - setDisplayValueInternal(String value)
- Scoped GlideDateTime - setDisplayValueLang(String dateTime, String style)
- Scoped GlideDateTime - setDisplayValueLang(String dateTime, String style, String
language)
- Scoped GlideDateTime - setGlideDateTime(GlideDateTime g)
- Scoped GlideDateTime - setMonthLocalTime(Number month)
- Scoped GlideDateTime - setMonthUTC(Number month)
- Scoped GlideDateTime - setValue(String o)
- Scoped GlideDateTime - setValueUTC(String dt, String format)
- Scoped GlideDateTime - setYearLocalTime(Number year)
- Scoped GlideDateTime - setYearUTC(Number year)
- Scoped GlideDateTime - subtract(GlideTime time)
- Scoped GlideDateTime - subtract(Number milliseconds)
- Scoped GlideDateTime - subtract(GlideDateTime start, GlideDateTime end)
- Scoped GlideDateTime - toString()