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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s