Contact Support
Formatting in .NET MAUI Time Picker (SfTimePicker)
Format is a way to represent the time in a different string format. You can customize the time format using the Format property in PickerTimeFormat. The default format is HH_mm_ss
.
The different types of formats are:
H_mm
- Represents the hour minute in H_mm format.
H_mm_ss
- Represents the hour minute second in H_mm_ss format.
h_mm_ss_tt
- Represents the hour minute second meridiem in h_mm_ss_tt format.
h_mm_tt
- Represents the hour minute meridiem in h_mm_tt format.
HH_mm
- Represents the hour minute in HH_mm format.
HH_mm_ss
- Represents the hour minute second in HH_mm_ss format.
hh_mm_ss_tt
- Represents the hour minute second meridiem in hh_mm_ss_tt format.
hh_mm_tt
- Represents the hour minute meridiem in hh_mm_tt format.
hh_tt
- Represents the hour meridiem in hh_tt format.
Default
- Represents the hour minute second meridiem in default culture based format.
The following example demonstrates the Time Picker with the custom format PickerTimeFormat.hh_mm_ss_tt
<picker:SfTimePicker x:Name="timePicker"
Format="hh_mm_ss_tt"/>
SfTimePicker timePicker = new SfTimePicker()
{
Format = PickerTimeFormat.hh_mm_ss_tt;
};
this.Content = timePicker;