Set date and time format used by Datetime

Asked

Viewed 675 times

2

I have an application where you have time to register, which I use DateTime.Now, and an initial and final date that the user reports. By displaying this data in a DataGrid they are in format MM/dd/yyyy hh:mm tt. I want it to be shown in the Brazilian standard dd/MM/yyyy hh:mm. How can I set this for the DateTime?

Datagrid:

SS

  • What have you tried? How’s your code? Tried <DataGridTextColumn Binding="{Binding DataInicio, StringFormat=\{0:dd.MM.yy HH:mm\}}" />?

  • Perfect, that’s exactly what I wasn’t able to do. I didn’t know how to set the format to be shown. Thank you

2 answers

4


2

Try:

 DataFormatString="{0:dd/MM/yyyy HH:mm}"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.