Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 777.7k

Date Time Convertion in C# into DD-MMM-YYYY Format

Apr 30 2014 1:46 AM
Sir,
 
 
I want to convert a datetime value from database into DD-MMM-YYYY format in c#.
 
In SQL SP, I coded as :
 
(CONVERT(VARCHAR(20),A0505.BKDATE,105)) AS DATE
 
In this code, I getting the result as I intended.
 
And in C# code :-
 
bookingDate =Convert.ToDateTime(rdr["DATE"].ToString())
 
In this code, the result is  ' DD-MMM-YYYY : 12:00:00 AM'. How can set this code into 'DD-MMM-YYY'
 
 

Answers (6)