Adding or removing time
There are multiple methods for adding or removing time from a GlideDateTime object once it's initialized. Here are a few of the more useful ones.
The add() method accepts one of two types of arguments: either a GlideTime object (an object containing a specific duration or amount of time) or a number of milliseconds.
You can add a specific number of days (local time or UTC) using addDaysLocalTime() or addDaysUTC(). Neither method returns a value.
The same is true for adding time week-by-week (addWeeksLocalTime()and addWeeksUTC()), month-by-month (addMonthsLocalTime()and addMonthsUTC()), and even year-by-year (addYearsLocalTime() and addYearsUTC()).
The following snippet demonstrates several ways to add time to a GlideDateTime ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access