Let's go more deep..
Response.Write method doesn't have an overload for DateTime, that's why this calls Response.Write(object) overload. And here how it's implemented;
public virtual void Write(Object value) { if (value != null) { IFormattable f = value as IFormattable; if (f != null) Write(f.ToString(null, FormatProvider)); else Write(value.ToString()); } }
Since DateTime implementes IFormattable interface, this will generate
f.ToString(null, FormatProvider)
as a result. And from DateTime.ToString(String, IFormatProvider) overload.
If format is null or an empty string (""), the standard format specifier, "G", is used.
Looks like your CurrentCulture's ShortDatePattern is M/d/yyyy and LongTimePattern is h:mm:ss tt and that's why you get 2/5/2015 3:00:00 PM as a result.
As a solution, you can get string representation of your DateTime with .ToString() method and supply to use HttpResponse.Write(String) overload to get exact representaiton.
Response.Write(endDateDt.ToString("dd-MM-yyyy HH:mm", CultureInfo.InvariantCulture));
DateTimevalue has no format, it is just a value representing a point in time, the format you parsed it from has no bearing on this, it is only used to parse the input string. When you write it back out, either you specify a format, or you get some default format depending on the current culture.