Culture aware DateTime formatting

There are various DateTime.ToString() format specifiers which are culture aware, which can be very useful to show the date in a native format, e.g. Christmas day 2017

Culture ToString(“d”) ToString(“g”)
en-GB 25/12/2017 25/12/2017 00:00
en-US 12/25/2017 12/25/2017 12:00 AM
en-CA 2017-12-25 2017-12-25 12:00 AM

However, note the ‘official’ format isn’t always that most used by the people – see en-CA above.

Advertisements