- 1、本文档共28页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
sql日期格式(国外英文资料)
sql日期格式(国外英文资料)
Key word: sqlserver date, string format conversion
What? SELECT? Convert (char, your date field, 120)? As? Date2? FROM? Table?
MSSQL defaults to output in system time format, and you can adjust the systems time format to resolve it
Of course, in the program to solve more flexible, convert (char, date, N) output in each of the styles
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?
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?
SQL to_char date conversion string
2009-04-27 12:24
1, conversion function
The most important thing to do with the date operation is the two translation function: to_date (), to_char ()
To_date () acts to convert character types into a date type in a certain format:
Specific usage: to_date (2004-11-27,yyyy-mm-dd), the former is a string, the latter is the conversion date format, note that the front and back should be one-to-one correspondence.
For example, to_date (2004-11-27, 13:34:43,yyyy-mm-dd, hh24:mi:ss) will get the exact time
Multiple date formats:
YYYY: the year in which the four bit represents
YYY, YY, Y: the last three, two or one of the year, default to the current century
MM:01~12s month number
MONTH: nine characters representing the month, and the right side is filled with spaces
MON: abbreviation for t
您可能关注的文档
- 11-12学年新目标九年级上学期期末总温习(国外英文资料).doc
- 11.5高二以前分词用法小结一对一用(国外英文资料).doc
- 1111中学英语优质教案(国外英文资料).doc
- 100个轻易写错的成语(国外英文资料).doc
- 11、Some和any的用法及演习(国外英文资料).doc
- 11《争辩的故事》(国外英文资料).doc
- 11天7次记忆法(国外英文资料).doc
- 11秋北语——多媒体应用基础(含答案)(国外英文资料).doc
- 11精品初中英语虚拟语气讲解及演习(国外英文资料).doc
- 12.4机械能与内能的相互转化(一)教案(国外英文资料).doc
- 中国国家标准 GB/T 4214.17-2024家用和类似用途电器噪声测试方法 干式清洁机器人的特殊要求.pdf
- GB/T 4214.17-2024家用和类似用途电器噪声测试方法 干式清洁机器人的特殊要求.pdf
- 《GB/Z 43202.1-2024机器人 GB/T 36530的应用 第1部分:安全相关试验方法》.pdf
- GB/Z 43202.1-2024机器人 GB/T 36530的应用 第1部分:安全相关试验方法.pdf
- 中国国家标准 GB/Z 43202.1-2024机器人 GB/T 36530的应用 第1部分:安全相关试验方法.pdf
- 中国国家标准 GB/T 32455-2024航天术语 运输系统.pdf
- GB/T 32455-2024航天术语 运输系统.pdf
- 《GB/T 32455-2024航天术语 运输系统》.pdf
- GB/T 44369-2024用于技术设计的人体运动生物力学测量基础项目.pdf
- 中国国家标准 GB/T 44369-2024用于技术设计的人体运动生物力学测量基础项目.pdf
文档评论(0)