Home > DeveloperSection > Forums > How to convert Datetime Format C#?
marcel ethan
marcel ethan

Total Post:105

Points:735
Posted on    November-14-2014 2:23 AM

 ASP.Net C#  DateTime 
Ratings:


 1 Reply(s)
 762  View(s)
Rate this:

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?



Takeshi Okada
Takeshi Okada

Total Post:89

Points:629
Posted on    November-14-2014 6:17 AM

use DateTime to do the conversion for you

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

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


Don't want to miss updates? Please click the below button!

Follow MindStick