文章搜索: 分类 关键字

   您的位置:首页网络编程Php专区 → 数据库的日期格式转换
数据库的日期格式转换
日期:2006-7-22 7:38:49 人气:     [ ]
只要在convert中指定日期格式的代号就够了,如:

select convert(char(20),getdate(),101)
select emp_id,convert(char(20),hire_dt,101) from employee


-----------------------------------------------------

日期格式          代号
-------------------- -----------
04/05/2000          101

-------------------- -----------
2000.04.05          102

-------------------- -----------
05/04/2000          103

-------------------- -----------
05.04.2000          104

-------------------- -----------
05-04-2000          105

-------------------- -----------
05 Apr 2000         106

-------------------- -----------
Apr 05, 2000         107

-------------------- -----------
11:33:24           108

-------------------- -----------
Apr 5 2000 11:33:24     109

-------------------- -----------
04-05-2000          110

-------------------- -----------
2000/04/05          111

-------------------- -----------
20000405           112
出处:CnCode转载收集 作者:不详
<---->
 
| 关于本站 | 帮助(?) | 广告服务 | 版权声明 | 业务合作 | 发展历程 | 加盟我们 | 联系我们 | 中国源码中心 ≮为您提供建站帮助≯

  中国源码中心 版权所有 Copyright© 2002-2006 Www.CnCode.Com, All Rights Reserved. Powered By 中国源码中心