This is a migrated thread and some comments may be shown as answers.

Formatstring - Time Problem

3 Answers 161 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 03 Oct 2011, 12:15 PM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 03 Oct 2011, 12:43 PM
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
0
Karl
Top achievements
Rank 1
answered on 03 Oct 2011, 01:25 PM
Thanks Emanuel,
wish everything in life would be that simple!
Karl
0
Emanuel Varga
Top achievements
Rank 1
answered on 03 Oct 2011, 01:41 PM
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
Tags
GridView
Asked by
Karl
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Karl
Top achievements
Rank 1
Share this question
or