Databinder.Eval format time

Posted on 2011-10-21
Last Modified: 2012-05-12
Can anyone tell me why the following format string is not working on a SQL field of DateTime when the value of the column is; 23/08/2011 08:00:00


<%#DataBinder.Eval(Container.DataItem, "StartTime", "{0:HH:mm}")%>

Open in new window

Question by:swgdesign
    LVL 83

    Expert Comment

    Do you only want to show time?


    <%#DataBinder.Eval(Container.DataItem, "StartTime", "{HH:mm}")%>

    Accepted Solution

    I 'overlooked' the sql column thinking it was datetime when infact it was a string!

    Author Closing Comment

    i solved the solution myself by chaning the sql column type to datetime, instead of nvarchar

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now