Index and length should refer to a location within the sequence

1

I need to break a variable to get the value of the database. Today my full return would be "2017-09-15T14: 01: 46" I only need 2017-09-15 and 14:01, I tried to do

.Substring (0.10) for the date and worked, already for the time I tried Substring (11,16) and the error that is in the title of the question occurs.

    
asked by anonymous 15.09.2017 / 19:19

1 answer

1

Can not you do something like this?

data.ToString("yyyy-MM-dd hh:MM")
    
15.09.2017 / 19:23