Question: I want to convert a string which contains the date in `yyyyMMdd` format to `mm-dd-yyyy` DateTime format. How do I get it?

Answer: 
```
var dateString = "20050802";
var date = myDate = DateTime.ParseExact(dateString,
                                    "yyyyMMdd",
                                    System.Globalization.CultureInfo.InvariantCulture);

```
```
CultureInfo provider = CultureInfo.CreateSpecificCulture("en-UK");   

string dateString = "19850121"; //in yyyyMMdd format 

string oldFormat = "yyyyMMdd"; 

DateTime result = DateTime.ParseExact(dateString, oldFormat, provider); //MM/dd/yyyyformat 

```