Date Formats (C#)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a date in a string as say "20/3/2007"

I want to format this as "Mar-07"

This seems to be not that straightforward in C#

In VB6 I could do this easily.

How can I format this to be "MMM - YY" ?
 
Hi,

I have a date in a string as say "20/3/2007"

I want to format this as "Mar-07"

This seems to be not that straightforward in C#

In VB6 I could do this easily.

How can I format this to be "MMM - YY" ?

string strDate = DateTime.ParseExact("20/3/2007", "dd/M/yyyy",
null).ToString("MMM-yy");
 
Back
Top