Date Functions
Modified on Tue, 22 Aug 2023
8 minutes read
This document is a draft version and subject to further review and revision. Please refrain from distributing or relying on its contents as final.
UI Element | Description |
---|---|
addMinutes | Add the specified number of minutes to the given date |
addMonths | Add the specified number of months to the given date |
addQuarters | Add the specified number of year quarters to the given date |
addWeeks | Add the specified number of weeks to the given date |
addYears | Add the specified number of years to the given date |
subBusinessDays | Substract the specified number of business days (mon - fri) to the given date, ignoring weekends |
subDays | Subtract the specified number of days from the given date |
subHours | Subtract the specified number of hours from the given date |
subMinutes | Subtract the specified number of minutes from the given date |
subMonths | Subtract the specified number of months from the given date |
subQuarters | Subtract the specified number of year quarters from the given date |
subWeeks | Subtract the specified number of weeks from the given date |
getDate | Get the day of the month of the given date |
getDay | Get the day of the week of the given date |
getDayOfYear | Get the day of the year of the given date |
getDaysInMonth | Get the number of days in a month of the given date |
getDaysInYear | Get the number of days in a year of the given date |
getDecade | Get the decade of the given date |
getHours | Get the hours of the given date |
getMinutes | Get the minutes of the given date |
getMonth | Get the month of the given date |
getQuarter | Get the year quarter of the given date |
getTime | Get the milliseconds timestamp of the given date. |
getWeek | Get the local week index of the given date |
getWeekOfMonth | Get the week of the month of the given date |
getWeekYear | Get the local week-numbering year of the given date |
getWeeksInMonth | Get the number of calendar weeks a month spans |
getYear | Get the year of the given date |
differenceInBusinessDays | Get the number of business days between the given dates |
differenceInCalendarMonths | Get the number of calendar months between the given dates |
differenceInCalendarQuarters | Get the number of calendar quarters between the given dates |
differenceInCalendarYears | Get the number of calendar years between the given dates |
differenceInDays | Get the number of full days between the given dates |
differenceInHours | Get the number of hours between the given dates |
differenceInMinutes | Get the number of minutes between the given dates |
differenceInMonths | Get the number of full months between the given dates |
differenceInQuarters | Get the number of quarters between the given dates |
differenceInWeeks | Get the number of full weeks between two dates. |
differenceInYears | Get the number of full years between the given dates |
setDate | Set the day of the month to the given date |
setDay | Set the day of the week to the given date |
setDayOfYear | Set the day of the year to the given date |
setHours | Set the hours to the given date |
setMinutes | Set the minutes to the given date |
setMonth | Set the month to the given date |
setQuarter | Set the year quarter to the given date |
setWeek | Set the local week to the given date, saving the weekday number |
setYear | Set the year to the given date |
isFirstDayOfMonth | Is the given date the first day of a month? |
isFriday | Is the given date Friday? |
isLastDayOfMonth | Is the given date the last day of a month? |
isLeapYear | Is the given date in the leap year? |
isMonday | Is the given date Monday? |
isSameMonth | Are the given dates in the same month (and year)? |
isSameQuarter | Are the given dates in the same quarter (and year)? |
isSameWeek | Are the given dates in the same week (and month and year)? |
isSameYear | Are the given dates in the same year? |
isSaturday | Is the given date Saturday? |
isSunday | Is the given date Sunday? |
isThisMonth | Is the given date in the same month as the current date? |
isThisQuarter | Is the given date in the same quarter as the current date? |
isThisWeek | Is the given date in the same week as the current date? |
isThisYear | Is the given date in the same year as the current date? |
isThursday | Is the given date Thursday? |
isToday | Is the given date today? |
isTomorrow | Is the given date tomorrow? |
isTuesday | Is the given date Tuesday? |
isWednesday | Is the given date Wednesday? |
isWeekend | Does the given date fall on a weekend? |
isYesterday | Is the given date yesterday? |
startOfDecade | Return the start of a decade for the given date |
startOfMonth | Return the start of a month for the given date. The result will be in the local timezone |
startOfQuarter | Return the start of a year quarter for the given date. The result will be in the local timezone |
startOfWeek | Return the start of a week for the given date. The result will be in the local timezone |
startOfWeekYear | Return the start of a local week-numbering year for the given date. |
startOfYear | Return the start of a year for the given date. The result will be in the local timezone |
eachWeekendOfYear | Get all the Saturdays and Sundays in the year |
endOfDecade | Return the end of a decade for the given date |
endOfMonth | Return the end of a month for the given date. The result will be in the local timezone. |
endOfQuarter | Return the end of a year quarter for the given date. The result will be in the local timezone |
endOfWeek | Return the end of a week for the given date. The result will be in the local timezone |
endOfYear | Return the end of a year for the given date. The result will be in the local timezone |
lastDayOfDecade | Return the last day of a decade for the given date |
lastDayOfMonth | Return the last day of a month for the given date. The result will be in the local timezone |
lastDayOfQuarter | Return the last day of a year quarter for the given date. The result will be in the local timezone |
lastDayOfWeek | Return the last day of a week for the given date. The result will be in the local timezone |
lastDayOfYear | Return the last day of a year for the given date. The result will be in the local timezone |
current_date | Return the current date |
current_time | Return the current time |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article