How to convert Datetime Format C#?

Here is my date time format displayed

Dr["DATE"] =========> Jun 27 2014 9:06PM

I want it to display like this one =========> 27.06.2014

Here is my code:

ltrlNotlar.Text = Dr["DATE"].ToString()

How to change first format to the second one?

Last updated:11/14/2014 6:17:38 AM

1 Answers

Takeshi Okada
Takeshi Okada

use DateTime to do the conversion for you

var dt = DateTime.Parse(Dr['DATE'].ToString());

ltrlNotlar.Text = dt.ToString('dd.MM.yyyy');