SQL Server time formatting

Source: Internet
Author: User

1 Declare @i int=12 begin3      while(@i<= $)4         begin5             BEGINTry6                     Print Convert(varchar(3),@i)+' '+Convert(VARCHAR,getdate(),@i)7             ENDTRY8             BEGINCatch9             EndCatchTen             Set @i=@i+1 One         End A End

Results:

1:11/30/14
2:14.11.30
3:30/11/14
4:30.11.14
5:30-11-14
6:30 11 14
7:11 30, 14
8:21:18:44
9:11 9:18:44:983pm
10:11-30-14
11:14/11/30
12:141,130
13:30 11 2014 21:18:44:983
14:21:18:44:983
20:2014-11-30 21:18:44
21:2014-11-30 21:18:44.983
22:11/30/14 9:18:44 PM
23:2014-11-30
24:21:18:44
25:2014-11-30 21:18:44.983
100:11 9:18pm
101:11/30/2014
102:2014.11.30
103:30/11/2014
104:30.11.2014
105:30-11-2014
106:30 11 2014
107:11 30, 2014
108:21:18:44
109:11 9:18:44:983pm
110:11-30-2014
111:2014/11/30
112:20,141,130
113:30 11 2014 21:18:44:983
114:21:18:44:983
120:2014-11-30 21:18:44
121:2014-11-30 21:18:44.983
126:2014-11-30t21:18:44.983
127:2014-11-30t21:18:45.030
130:8??? 1436 9:18:45:030pm
131:8/02/1436 9:18:45:030pm

SQL Server time formatting

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.