DateTime.Now.ToShortDateString(); replace month and day

.net, datetime, datetime-format

Solution

Use `DateTime.ToString` with the specified format `MM.dd.yyyy`:

this.TextBox3.Text = DateTime.Now.ToString("MM.dd.yyyy");

Here, `MM` means the month from 01 to 12, `dd` means the day from 01 to 31 and `yyyy` means the year as a four-digit number.

Problem

I need to change format of ``` this.TextBox3.Text = DateTime.Now.ToShortDateString(); ``` so it returns (for example) `25.02.2012`, but I need `02.25.2012` How can this be done?

Original source