Please enable JavaScript to view this site.


int = EncodeDate(nYear,nMonth,nDay)


This macro function calculates a western date from 3 integer literals or expressions representing the year, month and day.

nManOnTheMoon = EncodeDate(1969,7,21)
nBirthdayThisYear = EncodeDate(YearOf(Today()), nBirthMonth, nBirthDay)
nFirstDayCentury = EncodeDate(100*(nYear div 100), 1,1)

You will usually use dates obtained directly from other functions or system variables in your code, so you will rarely need to use this function, unless you want to create a specific date.


See also: EncodeJewishDate, FirstDateOfMonth, LastDateOfMonth, MoveMonths, WeekStartOfMonth.


Topic 108268, last updated on 18-Apr-2020