The following case: There is a string that has this format \"2012-02-25 07:53:04\"
But in the end, i rather want to end up with this format \"25-02-2012 07:53:04\">
Do this:
DateTime.Parse("2012-02-25 07:53:04").ToString("dd-MM-yyyy hh:mm:ss");
Keep in mind this isn't culture-aware. And if you do need to store the intermediate result you could do that just as easily:
var myDate = DateTime.Parse("2012-02-25 07:53:04");
var myDateFormatted = myDate.ToString("dd-MM-yyyy hh:mm:ss");
Lastly, check out TryParse() if you can't guarantee the input format will always be valid.