%p formatting for TimeSpanEditBox

Editors for WPF Forum

The latest build of this product (v21.1.1) was released 3 months ago, which was before this thread was created.
Posted 7 days 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 7 days 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

Add Comment

Please log in to a validated account to post comments.