Does DatePciker auto detect locale to display date
How do I know it is displaying US or British date Format?? What is the default dateformat?
开发者_如何学运维Q1) How to I convert the date to local locale after detecting the phone is in non-US locale? Q2) Which event to use after the user has entered the date and to do the conversion?
<toolkit:DatePicker x:Name="beginDatePicker" Margin="0,300,0,0" Width="220" HorizontalAlignment="Left"> </toolkit:DatePicker>
A DateTime
doesn't have a locale. Just take the Value
property, which will be a DateTime
, and it should be fine. (What "kind" it will be - unspecified, UTC or local - I'm not sure, but that's another matter.)
I haven't used this particular control, but I'd certainly expect it to use the current thread's UI culture and examine the CultureInfo.DateTimeFormat
property - then probably check the ShortDatePattern
- in order to get the most appropriate format for display / input.
You should check what happens if you put the emulator/phone into different locales though.
精彩评论