Hi Everyone,
Hope this conversion table will help to present date and time in proper way.
For example if you wish to see the current date, in MM/DD/YY please use 1 as a format:
Statement:
SELECT CONVERT(varchar(120),GETDATE(),1)
Will return you 12/28/17
In general, using SELECT CONVERT(varchar(120),GETDATE(),FORMAT)
Where FORMAT is just a number from the list will provide you respective output:
Sergey.
Hope this conversion table will help to present date and time in proper way.
For example if you wish to see the current date, in MM/DD/YY please use 1 as a format:
Statement:
SELECT CONVERT(varchar(120),GETDATE(),1)
Will return you 12/28/17
In general, using SELECT CONVERT(varchar(120),GETDATE(),FORMAT)
output style
Apr 2820149:31AM 0
04/28/141
14.04.282
28/04/143
28.04.144
28-04-145
28 Apr 146
Apr 28,147
09:31:288
Apr 2820149:31:28:580AM 9
04-28-1410
14/04/2811
14042812
28 Apr 201409:31:28:58013
09:31:28:58014
2014-04-2809:31:2820
2014-04-2809:31:28.58021
04/28/149:31:28 AM 22
2014-04-2823
09:31:2824
2014-04-2809:31:28.58025
Apr 2820149:31AM 100
04/28/2014101
2014.04.28102
28/04/2014103
28.04.2014104
28-04-2014105
28 Apr 2014106
Apr 28,2014107
09:31:28108
Apr 2820149:31:28:580AM 109
04-28-2014110
2014/04/28111
20140428112
28 Apr 201409:31:28:580113
09:31:28:580114
2014-04-2809:31:28120
2014-04-2809:31:28.580121
2014-04-28T09:31:28.580126
2014-04-28T09:31:28.580127
28جمادىالثانية14359:31:28:580AM 130
28/06/14359:31:28:580AM 131
All the best,Sergey.