Formatstring - Time Problem

4 posts, 1 answers
  1. Karl Golling
    Karl Golling avatar
    226 posts
    Member since:
    Jun 2005

    Posted 03 Oct 2011 Link to this post

    HI,
    I'm populating a RadGrid with an Accessdb which has a datetime column. In the RadGrid I have a column which is to show only the hour, minute and second. I use the Formatstring {0:h.mm.ss}.

    Problem: when the hour is a zero 00.01.01 in the db in the RadGrid it is displayed as 12.01.01.
    It displays correct when the time is 01.01.01.

    How can I display just 00.01.01?

    Thanks,
    Karl
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 03 Oct 2011 Link to this post

    Hello Karl,

    With a h pattern according to msdn "h" - The hour, using a 12-hour clock from 1 to 12.
    Why don't you juse 24h format? "H" or "HH" - The hour, using a 24-hour clock from 0 to 23.?

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Karl Golling
    Karl Golling avatar
    226 posts
    Member since:
    Jun 2005

    Posted 03 Oct 2011 Link to this post

    Thanks Emanuel,
    wish everything in life would be that simple!
    Karl
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 03 Oct 2011 Link to this post

    Hello again Karl,

    Life was not meant to be that simple :P

    Glad to be able to help,

    If you have any more questions please just let me know, and if the question has been solved, please mark the question as answered, so that others can find the answers to their questions faster.

    Best Regards,
    Emanuel Varga


    WinForms MVP
Back to Top