xamarin-forms-4

i want to format date ,i have "2019-06-30T23:00:00" this format and i want to display 6/30,so how to format?


I want to format a date in xamarin form ,I have "2019-06-30T23:00:00" this format ,I want to convert it to 6/30 , so how to convert .

I tried in xaml file with string format StringFormat='{}{0:dd.MM}'} but nothing is working from xaml file


Solution

  • As a fast and simple workaround try this:

    string str = "2019-06-30T23:00:00"; // code that gives you time
    str = str.Substring(5,2)+"/"+str.Substring(8,2));
    

    If you need better solution please specify how you retrieve the time.