数据库的日期格式转换_php教程-查字典教程网
数据库的日期格式转换
数据库的日期格式转换
发布时间:2016-12-29 来源:查字典编辑
摘要:只要在convert中指定日期格式的代号就够了,如:selectconvert(char(20),getdate(),101)selecte...

只要在convert中指定日期格式的代号就够了,如:

select convert(char(20),getdate(),101)

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

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

日期格式代号

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

04/05/2000101

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

2000.04.05102

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

05/04/2000103

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

05.04.2000104

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

05-04-2000105

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

05 Apr 2000106

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

Apr 05, 2000107

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

11:33:24108

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

Apr 5 2000 11:33:24109

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

04-05-2000110

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

2000/04/05111

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

20000405112

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新php教程学习
    热门php教程学习
    编程开发子分类