Format date and time optional

Discussion in 'ASP .Net' started by DavidC, Jul 21, 2010.

  1. DavidC

    DavidC Guest

    I have an asp.net page that has a GridView with bound columns. The date
    column is bound to a SQL datetime column. I have the formatting of the bound
    date to be Bind("ActivityDate", "{0:M/d/yyyy h:mm tt}") and it works fine.
    However, sometimes records do not have a time and show as 7/21/2010 12:00 AM

    Is there a way to not show the 12:00 AM as it is irrelevant when no time is
    entered? Thanks.
    --
    David
     
    DavidC, Jul 21, 2010
    #1
    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. Shaiboy_UK
    Replies:
    0
    Views:
    504
    Shaiboy_UK
    Oct 19, 2003
  2. Brian Candy
    Replies:
    2
    Views:
    1,194
    Janaka
    Feb 18, 2004
  3. Randall Parker

    Date/time with minutes and seconds optional?

    Randall Parker, Dec 8, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    852
    clintonG
    Dec 8, 2005
  4. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,332
    Michael Borgwardt
    May 30, 2004
  5. Summu82
    Replies:
    5
    Views:
    890
    Richard Heathfield
    Jun 7, 2006
Loading...

Share This Page