HeaderPane
Main
Hide
Share Link
Print

TodayDate

Defines the date a calendar treats as today.

C

BOOL WINAPI SftDate_GetTodayDate(HWND hwndCtl, LPSYSTEMTIME lpValue);
BOOL WINAPI SftDate_SetTodayDate(HWND hwndCtl, const SYSTEMTIME* lpValue);

C++

BOOL CSftDate::GetTodayDate(LPSYSTEMTIME lpValue) const;
BOOL CSftCalendar::GetTodayDate(LPSYSTEMTIME lpValue) const;
BOOL CSftDate::SetTodayDate(const SYSTEMTIME* lpValue);
BOOL CSftCalendar::SetTodayDate(const SYSTEMTIME* lpValue);

Parameters

hwndCtl

The window handle of the month calendar control (SftCalendar), or of the date field control (SftDate) whose dropdown calendar is affected.

lpValue

GetTodayDate: a pointer to a SYSTEMTIME structure that receives the date, or NULL.
SetTodayDate: a pointer to a SYSTEMTIME structure that holds the date, or NULL to use the current date.

Returns

GetTodayDate returns TRUE if a date was defined using SetTodayDate, which is then copied to lpValue. FALSE is returned if the calendar uses the current date.

SetTodayDate returns TRUE if the date was set, or FALSE if lpValue holds an invalid date.

Comments

The GetTodayDate and SetTodayDate functions define and retrieve the date a calendar treats as today: the date marked in the calendar (SetHighlightToday), shown and selected by the Today button (SetShowTodayButton) and reported in the fToday member of NM_SFTDATE_DAYFORMATTING. The time of lpValue is ignored.

By default (NULL) the current date is used, and the calendar follows it past midnight. An application can define a fixed date, for example a business date that differs from the computer's date, or for repeatable tests.

The default text "=Today" of a date field control (SetDefaultText) and the text typed by the user always use the current date.

The setting applies to a month calendar control and to the dropdown calendar of a date field control. SYSTEMTIME values are always Gregorian dates, regardless of the calendar system of the control's culture (SetCulture).

See Also C/C++ API | Categories | Notifications


Last Updated 11/26/2026 - (email)
© 2026 Softel vdm, Inc.