Question: I need to format a date to the following format:

`M-d-yyyy`

I tried using:

`string.Format("{0:M-d-yyyy}", DateTime.Now)`

But the output string will depend on the CurrentCulture on the computer where it's run, so sometimes the output might be `07/09/2014` or `07.09.2014` instead of `09-07-2014`.

How can I easily prevent it from converting it based on the culture and treating it as a literal string?

Answer: 
Use `CultureInfo.InvariantCulture` as the culture or provider argument.

```
String.Format(CultureInfo.InvariantCulture, "{0:M-d-yyyy}", DateTime.Now)

```
you can try
date.ToString("MM/dd/yy", yyyymmddFormat);

or
try whats in this link
<http://social.msdn.microsoft.com/Forums/en-US/af4f5a1e-f81d-47fe-981d-818e785b8847/convert-string-to-datetime-object>

you can force the string into a standard format if you like