What layer of a system should a date be formatted? Should the date be formatted when it is selected from the database (data layer) or should it be formatted at the presentation layer?
I am thinking that the formatting is a visual preference so I would tend to put it as close to the presentation layer as possible.
Where do you store the format string for the preferred date?
The date (also like money and other numerical formats) should be formatted at the presentation layer. The format string would typically be part of the locale information. I'd suggest reading up on internationalization (also known as i8n). Given your moniker is C#'ish here is one place to look:
Microsoft .Net Internationalization
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