Question: I have a date and time which should be copied to DateTime object without changing its format.
Is there a way to resolve it?

Pls see the code below

```
string dateTime = "07/20/11 14:40:28";
DateTime copyDateTime = Convert.ToDateTime(dateTime);
string dateTime2 = copyDateTime.ToString();

```

Output: 

{7/20/2011 2:40:28 PM}

If you notice the output, it got changed to PM. I want it as it is. How to get it?

EDIT:
I want dateTime2 to have the value exactly as it was for dateTime.

Answer: 
Format is not intrinsically associated with the `DateTime`. Format is simply a display property.

If you need to display it in your preferred format than simply call:

```
Console.WriteLine(copyDateTime.ToString("G"));

```

See [MSDN](http://msdn.microsoft.com/en-us/library/az4se3k1.aspx) for a complete list of standard format strings.
Before outputting, you need to convert the DateTime back into a string. By default, it simply calls "ToString" which uses the default DateTime format configured for the current user/locale.

Use ToString and specify a format to convert the datetime back into a String, then you can control the format.