date format question

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")))%>
 
E

Eric Theil

Try:

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

lowercase m represents minutes and uppercase represents months

e
 
G

Guest

BRILLIANT!!! well done works perfectly.

Eric Theil said:
Try:

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

lowercase m represents minutes and uppercase represents months

e
 

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


Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top