Home >Backend Development >PHP Tutorial >php mssql time format problem_PHP tutorial

php mssql time format problem_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:47:47979browse

Of course, it is more flexible to solve it in the program, for example:

"select convert(char, date field, 120) as date2 from table"

convert(char, date, N) output Medium Style
N Date Style
0 04 2 2005 9:06AM
1 04/02/05
2 05.04.02
3 02/04/05
4 02.04.05


5 02-04-05
6 02 04 05
7 04 02, 05
8 09:06:18
9 04 2 2005 9:06: 18:857AM
10 04-02-05
11 05/04/02
12 050402
13 02 04 2005 09:06:18:857
14 09:06:18: 857
20 2005-04-02 09:06:18
21 2005-04-02 09:06:18.857
22 04/02/05 9:06:18 AM
23 2005- 04-02
24 09:06:18
25 2005-04-02 09:06:18.857
100 04 2 2005 9:06AM
101 04/02/2005
102 2005.04 .02
103 02/04/2005
104 02.04.2005
105 02-04-2005
106 02 04 2005
107 04 02, 2005
108 09:06: 18
109 04 2 2005 9:06:18:857AM
110 04-02-2005
111 2005/04/02
112 20050402
113 02 04 2005 09:06:18 :857
114 09:06:18:857
120 2005-04-02 09:06:18
121 2005-04-02 09:06:18.857
126 2005-04-02T09 :06:18.857

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319835.htmlTechArticleOf course, it is more flexible to solve it in the program, for example: “select convert(char, date field, 120) as date2 from table” convert(char,date,N) outputs each style N Date style 0 04 2 2...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn