%p formatting for TimeSpanEditBox

Editors for WPF Forum

Posted 3 years ago by Sherman Ortega
Version: 14.1.1
Avatar

Hi Actipro,

I am currently looking for a way to display AM/PM in your TimeSpanEditBox. The format specifier for this is "tt" i.e. 

"hh:mm tt" // will give "03:00 AM"

but this doesn't seem to be accepted by the control because instead of displaying AM/PM, the letters "tt" are displayed in the TimeSpanEditBox.

TimeSpanEditBox displays: "03:00 tt"

Can you help me with this one? I am using version 14.1

Thanks!

Comments (1)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

"tt" isn't a valid format specified for TimeSpan objects (per Microsoft docs).  It only works when formatting DateTime objects.  Since TimeSpanEditBox edits TimeSpan objects, that's why it's showing "tt" when that format specifier is used.  It thinks it's literal text.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.