HeaderPane
Main
Hide
Share Link
Print

TimeInterval

Defines the interval between the times of the time list.

C

int WINAPI SftDate_GetTimeInterval(HWND hwndCtl);
BOOL WINAPI SftDate_SetTimeInterval(HWND hwndCtl, int minutes);

C++

int CSftDate::GetTimeInterval() const;
BOOL CSftDate::SetTimeInterval(int minutes);

Parameters

hwndCtl

The window handle of the date field control (SftDate).

minutes

The interval in minutes, 1 through 720.

Returns

GetTimeInterval returns the interval in minutes.

SetTimeInterval returns TRUE if the value is valid, otherwise FALSE.

Comments

The GetTimeInterval and SetTimeInterval functions define and retrieve the interval between the times of the time list (SFTDATE_TIMESTYLE_LIST, see SetTimeDropDownStyle). The default is 30 minutes. The list starts at midnight; the time of the value is selected, or the nearest time before it.

A new interval closes the dropdown if it is open. This function applies to the date field control only. For a month calendar control, GetTimeInterval returns 0 and SetTimeInterval has no effect and returns FALSE.

Examples

C View entire sample code

        SftDate_SetHighContrastMode(c[i], SFTDATE_HIGHCONTRAST_AUTO);
        SftDate_SetImageScaling(c[i], SFTDATE_IMAGESCALING_STRETCH);
        SftDate_SetValue(c[i], &now);
    }

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_LONGDATE), SFTDATE_FORMAT_LONGDATE);

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_TIMELIST), SFTDATE_FORMAT_SHORTTIME);
    SftDate_SetTimeInterval(GetDlgItem(hwndDlg, IDC_TIMELIST), 15);

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_TIMECLOCK), SFTDATE_FORMAT_SHORTTIME);
    SftDate_SetTimeDropDownStyle(GetDlgItem(hwndDlg, IDC_TIMECLOCK), SFTDATE_TIMESTYLE_CLOCK);

    SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_DATETIME), SFTDATE_FORMAT_SHORTDATETIME);

    SftDate_SetSelectionMode(GetDlgItem(hwndDlg, IDC_RANGE), SFTDATE_SELECTION_RANGE);

C++ View entire sample code

        Control(i).SetHighContrastMode(SFTDATE_HIGHCONTRAST_AUTO);
        Control(i).SetImageScaling(SFTDATE_IMAGESCALING_STRETCH);
        Control(i).SetValue(&now);
    }

    m_Fields[1].SetFormat(SFTDATE_FORMAT_LONGDATE);

    m_Fields[2].SetFormat(SFTDATE_FORMAT_SHORTTIME);
    m_Fields[2].SetTimeInterval(15);

    m_Fields[3].SetFormat(SFTDATE_FORMAT_SHORTTIME);
    m_Fields[3].SetTimeDropDownStyle(SFTDATE_TIMESTYLE_CLOCK);

    m_Fields[4].SetFormat(SFTDATE_FORMAT_SHORTDATETIME);

    m_Fields[5].SetSelectionMode(SFTDATE_SELECTION_RANGE);

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


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