Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAML string formatting in windows phone

How i can format DateTime in the given format (7/24/13, 11:24 AM), I found an option to format the string in similar manner [Text="{Binding CreatedDate, StringFormat={0:g}}"], But I cannot add (",") comma in between date and time. How i can do this in windows phone. Currently with the string format i am getting the date like this (7/24/13 11:24 AM).

like image 448
Nitha Paul Avatar asked Aug 22 '13 09:08

Nitha Paul


1 Answers

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

will give you

08/22/2013, 11:52 AM

like image 87
Matt Avatar answered Nov 05 '22 08:11

Matt