SetToday

Description

Sets the value that is used by the calendar as today's date.

Applies to

DatePicker, MonthCalendar controls

Syntax

controlname.SetToday ( d )

Argument

Description

controlname

The name of the control for which you want to set the Today date

d

The date you want to specify as the Today date


Return value

Integer.

Returns 0 for success and -1 for failure.

Usage

By default, the current system date is set as the Today date. You can use the SetToday function to specify a different date. If the date is set to any date other than the current system date, the following restrictions apply:

  • The control does not automatically update the Today selection when the time passes midnight for the current day.

  • The control does not automatically update its display based on locale changes.

Examples

This example gets a date from an EditMask control and sets it as the Today date in a MonthCalendar control:

Date currentdate
integer li_return

currentdate = Date(em_1.Text)
li_return = mc_1.SetToday(currentdate)

See also

GetToday