Windows Phone 中的 XAML 字符串格式化

8

我如何按照给定格式(7/24/13, 11:24 AM)格式化DateTime?我找到了一个将字符串以类似方式格式化的选项 [Text="{Binding CreatedDate, StringFormat={0:g}}"],但我无法在日期和时间之间添加(",")逗号。在Windows phone上我该怎么做。当前,使用字符串格式化,我得到的日期是这样的(7/24/13 11:24 AM)。

1个回答

5
<TextBlock Text="{Binding Date, StringFormat='{}{0:MM/dd/yyyy, h:mm tt}'}" />

我会为你提供

2013年8月22日 上午11:52


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接