Reputation: 65
I'm building a simple WPF app in VS 15 .NET 4.5 and in need of Time Picker. i used Material Design
<materialDesign:TimePicker Grid.Row="1" Grid.Column="2" Is24Hours="False" x:Name="tPicker" HorizontalAlignment="Stretch" Margin="0 0 0 10" materialDesign:HintAssist.Hint="Pick Time" />
i'm getting only the time. there were no AM/PM
Upvotes: 0
Views: 1423
Reputation: 169320
If you want to show AM/PM next to the time, you will either have to change your computer's regional settings in the Control Panel:
Or you could set the CurrentCulture
of the UI thread:
public MainWindow()
{
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
InitializeComponent();
}
I am afraid you can't specify a custom format besides Long
and Short
:
Set 24-hour time format for TimePicker
Upvotes: 1