Equinox Online Help - Language Reference - A to Z

Home

Dmy

Applies to
SyntaxDmy(DaysExpression, MonthsExpression, YearsExpression)
Action[Function] Returns a date.
ScopeUsable anywhere.
Notes

This function returns a date value, based on DaysExpression, MonthsExpression and YearsExpression. The arguments default to numbers, but Equinox will also accept dates. If you do use a date, then the relevant part is used. Equinox corrects invalid argument to the nearest legal value. You may also use the wildcard date '?-?-?' as an argument. If the year is specified as a two digit number, the value in the system workarea SysCentury is added to arrive at the year.

CategoryDate handling
See Also Years, Year, Dayname, Dayofweek, Dayofyear, Dmyadd, Leapyear, Month, MonthName, Months, ServerDateTime, Today, Week, WeekOfYear, WeekStart
Example

This example sets EventDate to 14th July 1789.

EventDate = Dmy(14, 7, 1789)

The next example sets NextDate to be the 12th of the current month. The month and the year are taken from the current date.

NextDate = Dmy(12, Today, Today)

In this last example, paydate is assigned the last day of the next month. First one month is added to today and the result assigned to paydate; this copes with a wrap-around to the next year. The day is then set to 31 and the function automatically assigns the closest valid day.

paydate = Dmyadd(Today, , 1)
paydate = Dmy(31, paydate, paydate)