3

I'd like to show a date range in a succinct way but also have it look good in other countries, are there any standards for formatting date ranges in other countries? So far for the US I've found that this seems the most correct...

Aug 2 - 9 2015
Aug 2 - Sept 15 2015
Aug 2 2015 - Jan 6 2016
3
  • 1
    This is really difficult because different countries format dates differently. It would help if you included more information on what you need it for
    – Oztaco
    Aug 5, 2015 at 0:38
  • Oztaco sorry thats what im asking for... how do other countries format date ranges, or what are at least the common ways they do?
    – Kev
    Aug 5, 2015 at 20:12
  • 1
    Does this answer your question? Which date format to use? Jul 25 at 14:21

3 Answers 3

1

This Wikipedia article should be what you're looking for.

A good chunk of the countries use DMY format (i.e. 2 August 2015), so using that would cover a pretty large amount of people. Quite a few also use the YMD format (i.e. 2015-8-2), however, and America uses the MDY format (i.e. August 2, 2015 or (less commonly) with an ordinal: August 2nd, 2015).

Also, each country differs in not only the order but the formatting as well. For example, some use only numbers, while some use the name of the month as well.

Luckily however, many programming languages and frameworks (such as Microsoft .NET and Java) have a built in formatter so that you don't have to format it by hand.

I couldn't find anything specifically about formatting date ranges in different cultures, though. However, the EN dash is made for use in ranges (see this answer).

0

Every computer has culture and lang settings that determine the date convention (either for short or long dates). For mobile, just show dates as users have configured in their phone settings. For web, you can show in the culture of the website, and that will be consistent with content.

Whatever you do, do not forget to include timezone if date range includes hours.

0

To whomever stumbles here, there is now a function in browsers that handles this issue and includes preferences for many languages and regions.

See documentation for Intl.DateTimeFormat.prototype.formatRange() on MDN.

Example:

const date1 = new Date(Date.UTC(2023, 0, 10, 10))
const date2 = new Date(Date.UTC(2023, 0, 20, 10))

const fmten = new Intl.DateTimeFormat('en', {
  year: 'numeric',
  month: 'short',
  day: 'numeric',
})

const fmtde = new Intl.DateTimeFormat('de', {
  year: 'numeric',
  month: 'short',
  day: 'numeric',
})

console.log(fmten.formatRange(date1, date2))
// -> 'Jan 10 – 20, 1906'

console.log(fmtde.formatRange(date1, date2))
// -> '10.–20. Jan. 1906'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.