Date Time intervals in .NET MAUI Date Time Picker (SfDateTimePicker)

18 Nov 20188 minutes to read

The SfDateTimePicker provides seven intervals in .NET MAUI Date Time Picker. Use these to control the step size shown for each date or time column.

Day interval

Sets the interval between days using the DayInterval property of SfDateTimePicker.

<ContentPage
    . . .
    xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker">
    <picker:SfDateTimePicker x:Name="picker"
                             DayInterval="2"/>
</ContentPage>
using Syncfusion.Maui.Picker;
. . .
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        SfDateTimePicker picker = new SfDateTimePicker();
        picker.DayInterval = 2;
        this.Content = picker;
    }
}

Day interval in .NET MAUI Date Time picker.

Month interval

Sets the interval between months using the MonthInterval property of SfDateTimePicker.

<ContentPage
    . . .
    xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker">
    <picker:SfDateTimePicker x:Name="picker"
                             MonthInterval="2"/>
</ContentPage>
using Syncfusion.Maui.Picker;
. . .
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        SfDateTimePicker picker = new SfDateTimePicker();
        picker.MonthInterval = 2;
        this.Content = picker;
    }
}

Month interval in .NET MAUI Date Time Picker.

Year interval

Sets the interval between years using the YearInterval property of SfDateTimePicker.

<ContentPage
    . . .
    xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker">
    <picker:SfDateTimePicker x:Name="picker"
                             YearInterval="2"/>
</ContentPage>
using Syncfusion.Maui.Picker;
. . .
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        SfDateTimePicker picker = new SfDateTimePicker();
        picker.YearInterval = 2;
        this.Content = picker;
    }
}

Year interval in .NET MAUI Date Time picker.

Hour interval

Sets the interval between hours using the HourInterval property of SfDateTimePicker.

<ContentPage
    . . .
    xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker">
    <picker:SfDateTimePicker x:Name="picker"
                             HourInterval="2"/>
</ContentPage>
using Syncfusion.Maui.Picker;
. . .
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        SfDateTimePicker picker = new SfDateTimePicker();
        picker.HourInterval = 2;
        this.Content = picker;
    }
}

Hour interval in .NET MAUI Date Time picker.

Minute interval

Sets the interval between minutes using the MinuteInterval property of SfDateTimePicker.

<ContentPage
    . . .
    xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker">
    <picker:SfDateTimePicker x:Name="picker"
                             MinuteInterval="2"/>
</ContentPage>
using Syncfusion.Maui.Picker;
. . .
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        SfDateTimePicker picker = new SfDateTimePicker();
        picker.MinuteInterval = 2;
        this.Content = picker;
    }
}

Minute interval in .NET MAUI Date Time picker.

Second interval

Sets the interval between seconds using the SecondInterval property of SfDateTimePicker.

<ContentPage
    . . .
    xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker">
    <picker:SfDateTimePicker x:Name="picker"
                             SecondInterval="2"/>
</ContentPage>
using Syncfusion.Maui.Picker;
. . .
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        SfDateTimePicker picker = new SfDateTimePicker();
        picker.SecondInterval = 2;
        this.Content = picker;
    }
}

Second interval in .NET MAUI Date Time picker.

Millisecond interval

Sets the interval between milliseconds using the MilliSecondInterval property of SfDateTimePicker. To display milliseconds, the TimeFormat must include a fractional component such as fff.

<ContentPage
    . . .
    xmlns:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker">
    <picker:SfDateTimePicker x:Name="picker"
                             TimeFormat="hh_mm_ss_fff_tt"
                             MilliSecondInterval="2"/>
</ContentPage>
using Syncfusion.Maui.Picker;
. . .
public partial class MainPage : ContentPage
{
    public MainPage()
    {
        InitializeComponent();
        SfDateTimePicker picker = new SfDateTimePicker();
        picker.TimeFormat = "hh_mm_ss_fff_tt";
        picker.MilliSecondInterval = 2;
        this.Content = picker;
    }
}

MilliSecond interval in .NET MAUI Date Time picker.