1

I am trying to get DateTimePicker value in dd/MM/yyyy hh:mm:ss tt format.DateTimePicker code is

<xctk:DateTimePicker x:Name="startDateTimePicker" Value="{Binding SelectedDate}" 
FormatString="dd/MM/yyyy hh:mm:ss tt" Width="280" Height="30" Watermark="Select DateTime"/>

I have mentioned the Format string as I want but it's giving me output as MM/dd/yyyy hh:mm:ss tt. Not getting why this is happening. My system date time is MM/dd/yyyy will that affect the result. If yes, how can I nullify that.

1 Answer 1

1

You should set the Format property to Custom for the FormatString to be applied.

Try this:

<xctk:DateTimePicker x:Name="startDateTimePicker" Value="{Binding SelectedDate}" 
                     Format="Custom"
                     FormatString="dd\/MM\/yyyy hh:mm:ss tt" Width="280" Height="30" Watermark="Select DateTime"/>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.