Can I use format on sqlDateTime object?

Discussion in 'ASP .Net' started by mhf, Oct 18, 2003.

  1. mhf

    mhf Guest

    I have a SqlDateTime object, but when I use DataBinder.Eval on it, the
    formatting is ignored:

    DataBinder.Eval(Container.DataItem, "mySqlDateTimeObj", "{0:d}")

    produces output like this: "10/17/2003 12:00:00 am"


    Why can't I use format specifiers on SqlDateTime objects??

    Thanks to anyone who can shed a little light ....

    Marc
    mhf, Oct 18, 2003
    #1
    1. Advertising

  2. mhf

    Natty Gur Guest

    Hi,

    you can use SQL server Convertto return date format as string :

    "Select OrderID, CustomerID, Convert(char(12), OrderDate, 107)
    from Northwind.Orders"

    Natty Gur[MVP]
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur, Oct 18, 2003
    #2
    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. damon.f
    Replies:
    2
    Views:
    7,766
    damon.f
    Jan 9, 2004
  2. poppy
    Replies:
    1
    Views:
    1,582
    Lars-Erik Aabech
    Apr 25, 2005
  3. Paperback Writer

    SqlDateTime overflow.

    Paperback Writer, Jun 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    5,307
    Jens Süßmeyer
    Jun 8, 2005
  4. Randy Smith
    Replies:
    0
    Views:
    522
    Randy Smith
    Apr 19, 2007
  5. Deshi
    Replies:
    1
    Views:
    2,469
    Andrew Morton
    Nov 5, 2009
Loading...

Share This Page