tags:

views:

15

answers:

1

i am facing issue to Removing time stamp while assigning(binding) a date to text block in silverlight t have been trying to do like this

date.Text = date.ToString(); date.text is a text block and xaml code is

in this case am getting output like date:2/2/2001 12:00:00 AM but i want output like date:2/2/2001

how can i do that? could any one help me

A: 

you should try date.Text = date.Date.ToString("d");

vlad
its not working
if i do like this it is working fine date.Text = date.Remove(date.Length - 12, 12); but i dont know this is appropriate way or not
you have to be more specific than 'its not working'
vlad
edit: fixed string format; let ME be more specific: if your `TextBlock` is named 'textBlock1' and your `DateTime` object is named 'date1', your line should be: `textBlock1.Text = date1.Date.ToString("d");`
vlad