Difference between dd-mm-yyyy and dd-mmm-yyyy
Solution 1
It is only Display style. mm is the number of the month (1..12) and mmm is the short Name of the month (jan, ... dec)
Solution 2
Basically, mm
shows the month as as a two-digit integer where 01 equals to January ... 12 equals to December.
mmm
on the other hand, will show the three-letter abbreviation of the month, respectively: Jan, Feb, Mar ... Dec.
dd-mm-yyyy
: '30-05-2016'
dd-mmm-yyyy
: '30-May-2016'
Solution 3
Like everywhere else in the world there are different standards for date format. You will at least find definitions for short dates and long dates format for each country. For instance in the U.K. the following are all valid:
- 6 Sept
- 6 September
- 6 September 2019
- 6th September 2019
- the 6th of September 2019
- the 6th of September, 2019
- 6/9/19, 6.9.19, or 6-9-19
- 06/09/2019, 06.09.2019, or 06-09-2019
- 6Sept2019, or 6-Sept-19
The first one in this list would be expressed as: d-mmm
.
The IETF regulates this standard and what mmm
refers to for date formats. It's basically a "short name" for the month. Pay attention, by this standard, it's case sensitive.
Eventhough it's regulated, mmm
can be confusing because in date & time formats it refers to milliseconds. (as per ISO 8601)
Solution 4
You can use both, just depending on your preference of how the month part is displayed: as number or as text (like 28-07-2016
or 28-Jul-2016
).
With the last option, users from other regions will not have any doubt about a date like April 3rd, because it is shown as 03-Apr-2017
, whilest the first option will display it as 03-04-2017
which on other regionales (en-us for example) stands for March 4th.
Comments
-
Abdul almost 2 years
Is it ok to use
dd-mm-yyyy
ordd-mmm-yyyy
for UK. I useddd-mmm-yyyy
format in my web application for UK.Select CONVERT(varchar(11),ArrivalDate,106)
But the
PM
asked me,Are you sure that this is the correct date format for UK ?
I searched on Web but find
dd-mm-yyyy
and nothing aboutdd-mmm-yyyy
for UK. Can you please tell me whether they both are two different formats for different countries or its just display style and could be used for a country like UK ? -
Kad almost 4 yearsCareful, by the IETF standard, it's case sensitive. therefore "jan" and "dec" aren't accepted dissplay value for
mmm
; it would be "Jan" and "Dec". tools.ietf.org/html/rfc7231#section-7.1.1.1