Search code examples
c#stringdatetimepretty-print

Smart Pretty Printing DateTime in C#


It may be that I need to implement this myself, but I figured I'd at least ask if there is some kind of a library or something in existence before I do so.

I'm looking to take a DateTime and pretty print it into things like

"Thursday at 1pm"

"Tomorrow at 8am"

or

"10 minutes from now"

Essentially taking a DateTime that is in the future and displaying it in a human readable string relative to the current date.

Like I said, if this something I gotta do myself - "Challenge Accepted" but I felt it was worth a quick question!

Thanks to all in advance!


Solution

  • Have a look at Humanizer I think it does what you want.