DataFormatString Date

  • Thread starter Nico VanHaaster
  • Start date
N

Nico VanHaaster

Hey guys,

This should be really simple however i just can't figure it out. I am
using a GridView to display hours results from a database. Now the date
field in the database is formated as a short date (Access) mm/dd/yyyy
however when ever it is displayed back on the page it is displayed as
MM/dd/yyyy hh:mm:ss

Now this is my code for the boundfield. Any Quick Pointers?
<asp:BoundField DataField="Date" DataFormatString="{0:MM/dd/yyyy}"
HeaderText="Date"
SortExpression="Date">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:BoundField>

Thanks In Advance

Nico
 

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

Members online

Forum statistics

Threads
473,836
Messages
2,569,748
Members
45,545
Latest member
rapter____0

Latest Threads

Top