DataFormatString Date

Discussion in 'ASP .Net Web Controls' started by Nico VanHaaster, Oct 4, 2006.

  1. 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
    Nico VanHaaster, Oct 4, 2006
    #1
    1. Advertising

  2. Nico VanHaaster

    ReyN Guest

    ReyN, Oct 5, 2006
    #2
    1. Advertising

  3. Of course..

    Thanks for Noticing that.

    Cheers Nico
    Nico VanHaaster, Oct 5, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    579
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,205
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    498
    Pete Becker
    Nov 8, 2003
  4. Matt
    Replies:
    3
    Views:
    699
    Richard Heathfield
    Nov 8, 2003
  5. cindy
    Replies:
    1
    Views:
    332
    Steven Cheng[MSFT]
    Apr 20, 2006
Loading...

Share This Page