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");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top