I have a customer that wants to see midnight represented as the end of the prior day.
Example
var date = DateTime.Parse("1/27/2010 0:00");
Console.WriteLine(date.ToString(<some format>));
Display:
1/26/2010 24:00
I believe this is valid in the ISO 8601 standard. (see this)
Is there any way to support this in .net (without an ugly string manipulation hack)?
I guess you'll need a custom formatter for the dates. Look at the IFormatProvider
and ICustomFormatter
interfaces.
This and this may also help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With