date format question

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

Guest

I have a problem trying to get a date format of dd/mm to appear in my web
page from a sql server database table. Various sites state that you can use
the{0:dd/mm/yyyy} format which works fine as does {0:d} for a result of '20
Oct' but {0:dd/mm} returns the day but only '00' for the month. Anyone any
ideas? Code I have is below. Thanks in advance.

<%#String.Format("{0:dd/mm}",
Convert.ToDateTime(Container.DataItem("Date")))%>
 
Try:

String.Format("{0:dd/MM}", ...);

lowercase m represents minutes and uppercase represents months

e
 
Back
Top