Date-time functions
The following functions can be used for date-time fields.
currentDate
The currentDate function returns the current date.
Example: currentDate()
-----------------------------------------------------------
currentDateTime
The currentDateTime function returns the current date and time as a date value.
By using this function you can calculate the difference of current date and time based on the application server’s time zone compared to the requested end date and time of an order.
*The currentDateTime function returns the current date and time of the application server. You can use it to compare “now” with all date–time fields, because the expressions are evaluated on the application server. So the application server compares both values in its own time zone. You cannot use this function to show the CurrentDateTime of the end user in a multi-time zone environment.
Example: currentDateTime()
-----------------------------------------------------------
currentTime
The currentTime function returns the current time.
Example: currentTime()
-----------------------------------------------------------
dateDiff
The dateDiff function calculates the difference (in minutes) between two dates.
Example: dateDiff(Visitors.'Expected time of departure', Visitors.'Expected arrival time')
-----------------------------------------------------------
calcDate
The calcDate function is used to add or subtract numbers to or from a selected date-time field. To subtract numbers, add a negative number.
The calcDate function adds <D> days, <M> months, <Y> years, <H> hours, <M> minutes and <S> seconds to a specified date-time, date or time <DT>.
In the following example, a column is created to subtract two days from the arrival date of a visitor to get a list of expected visiting dates. (This example can be extended to compare the result with the current date).
Example: calcDate(Visitors.'Visiting date',0,0,-2,0,0,0)
-----------------------------------------------------------
extractDay
The extractDay function extracts the day from a date (as a number).
Example: extractDay(Visitors.'Visiting date')
-----------------------------------------------------------
extractDayOfWeek
The extractDayOfWeek function extracts the day of the week from a given date. It returns a number where Monday = 1, Tuesday = 2, etc. It returns 0 if the date field is empty. This function can only be used for date fields.
Example: extractDayOfWeek(Visitors.’Visiting date’)
-----------------------------------------------------------
extractMonth
The extractMonth function extracts the month from a date (as a number).
Example: extractMonth(Orders.'Start date & time')
-----------------------------------------------------------
extractYear
The extractYear function extracts the year from a date (as a number).
Example: extractYear(Orders.'End date & time')
-----------------------------------------------------------
formatDate
The formatDate function changes a specified date-time into text according to a specified format.
Example: formatDate(Orders.'Start date & time', "yyyy/MM/dd HH:mm")
See also Mask.
-----------------------------------------------------------
parseDate
The parseDate function converts a text string into a date-time according to the specified format.
Example: parseDate("31-12-2014", "dd-MM-yyyy")
-----------------------------------------------------------
weekOf
The weekOf function returns the week number of the specified date-time.
Example: weekOf(Orders.'Start date & time')