Tuesday 15 June 2010

How to add a comma to a custom DateTime StringFormat in WPF -


I have a date and time displayed in the text block, it is currently displayed with this code "June 21 2013 10:30 AM "displays

  & lt; TextBlock style = "{StaticResource infoTextBlockStyle}" grid. Line = "0" grid Column = "3" text = "{binding safe message .centime, mode = oneway, string formatting = {} {0: mmm dd yyyy h: mm: ss tt}}" />   

I want to display it with commas after the day of the month: "June 21, 2013 10:30 am"

Just after adding a comma " DD "produces an error where the rear format string can not be identified. Is there a way to add commas to this custom string format?

Wrap format string in single quotes

  text = "{binding String formatting = '{} {0: MMM dd, yyyy h: mm: ss tt}'} "   

No comments:

Post a Comment