Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While exploring the new function FORMAT I have come across the following issue, would like to know if any one else has faced a similar problem and found the fix for this, or if it is a bug?

SELECT FORMAT(GETDATE(),'mm/dd/yyyy','en-US');


  1. 02/02/2013
  2. 2013-06-02 12:02:54.067
share|improve this question
up vote 7 down vote accepted

The Format function argument is a .net format string, where mm is minutes and MM is months. You specified minutes, so minutes is what you got.

There are example format strings at Standard Date and Time Format Strings. As an alternative to MM/dd/yyyy you can also use just d which is the Short Date Format specifier (detailed on the linked page).

share|improve this answer
+1 for a more comprehendible answer than mine :) – Roi Gavish Jun 2 '13 at 10:22
+1 but note that if you use d you lose leading zeros. – Aaron Bertrand Jun 2 '13 at 21:06

The FORMAT function is case sensitive
As such, "mm" stands for minutes and "MM" stands for month.

You can see a complete table of combinations and letter meanings here. This is the .NET article for date and time formatting, which SQL Server's FORMAT is using.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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