Reputation: 2120
Is it ok to use dd-mm-yyyy
or dd-mmm-yyyy
for UK. I used dd-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 about dd-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 ?
Upvotes: 9
Views: 75925
Reputation: 658
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:
The first one in this list would be expressed as: d-mmm
.
The IETF (via RFC 7231) 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)
Upvotes: 1
Reputation: 69470
It is only Display style.
mm
is the number of the month (1..12) andmmm
is the short Name of the month (jan, ... dec)Upvotes: 5
Reputation: 7490
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.
Upvotes: 1
Reputation: 194
dd-mm-yyyy requires values from 01 to 12 corresponding to month. dd-mmm-yyyy needs, Any month other than May to have a truncated value, Like for June you have to Jun.
Upvotes: 0
Reputation: 869
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'
Upvotes: 8