新聞中心
這里有您想知道的互聯(lián)網營銷解決方案
SQLServer常用日期格的轉換方法
以下的文章主要描述的是SQL Server 常用日期格式,以及對其在實際操作中的問題的處理,如果你對SQL Server 常用日期格式心存好奇的話,以下就是文章對其的具體介紹,望你瀏覽完以下的內容會有所收獲。

在瑪多等地區(qū),都構建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產品創(chuàng)新能力,以專注、極致的服務理念,為客戶提供成都做網站、網站設計 網站設計制作按需網站制作,公司網站建設,企業(yè)網站建設,品牌網站設計,全網整合營銷推廣,成都外貿網站建設公司,瑪多網站建設費用合理。
SQL Server 常用日期格式
SQL Server中文版的默認的日期字段datetime格式是yyyy-mm-dd Thh:mm:ss.mmm
例如:
- select getdate()
- 2004-09-12 11:06:08.177
整理了一下SQL Server里面可能經常會用到的日期格式轉換方法:
舉例如下:
- select CONVERT(varchar, getdate(), 120 )
- 2004-09-12 11:06:08
- select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')
- 20040912110608
- select CONVERT(varchar(12) , getdate(), 111 )
- 2004/09/12
- select CONVERT(varchar(12) , getdate(), 112 )
- 20040912
- select CONVERT(varchar(12) , getdate(), 102 )
- 2004.09.12
- select CONVERT(varchar(12) , getdate(), 101 )
- 09/12/2004
- select CONVERT(varchar(12) , getdate(), 103 )
- 12/09/2004
- select CONVERT(varchar(12) , getdate(), 104 )
- 12.09.2004
- select CONVERT(varchar(12) , getdate(), 105 )
- 12-09-2004
- select CONVERT(varchar(12) , getdate(), 106 )
- 12 09 2004
- select CONVERT(varchar(12) , getdate(), 107 )
- 09 12, 2004
- select CONVERT(varchar(12) , getdate(), 108 )
- 11:06:08
- select CONVERT(varchar(12) , getdate(), 109 )
- 09 12 2004 1
- select CONVERT(varchar(12) , getdate(), 110 )
- 09-12-2004
- select CONVERT(varchar(12) , getdate(), 113 )
- 12 09 2004 1
- select CONVERT(varchar(12) , getdate(), 114 )
- 11:06:08.177
以上的相關內容就是對SQL Server 常用日期格式的介紹,望你能有所收獲。
【編輯推薦】
- SQL Server所有表的列信息展示
- SQL Server 數(shù)據(jù)表信息的詳細描述
- SQL Server置疑的出現(xiàn)的原因,現(xiàn)象與破解
- 創(chuàng)建SQL Server全文檢索的2方案
- 實現(xiàn)SQL Server 2000全文索引遷移步驟
當前名稱:SQLServer常用日期格的轉換方法
當前地址:http://fisionsoft.com.cn/article/dppggpd.html


咨詢
建站咨詢
