patel
patel

Reputation: 635

Datetime Hour and Min formatting in xaml

i want to display Hour and Min in XAML binding,,

for example 13:20, 5.30 ....etc

for that, i wrote something like this :

Text="{Binding BookedFrom,StringFormat='{}{0:HH:mm'}"

but it is not working

can you give me correct formatting?

Upvotes: 0

Views: 2544

Answers (2)

Kumareshan
Kumareshan

Reputation: 1341

You can try the following

Text="{Binding BookedFrom,StringFormat=t}"

or

Text="{Binding BookedFrom,StringFormat=HH:mm}"

Upvotes: 1

Bizhan
Bizhan

Reputation: 17155

It should be:

Text="{Binding BookedFrom,StringFormat={}{0:HH:mm}}"

Upvotes: 3

Related Questions