SQL Server常用的日期格式轉換
作者: Ahan 日期: 2006-03-29 10:35
SQL Server中文版的預設的日期字串datetime格式是yyyy-mm-dd Thh:mm:ss.mmm
例如:
例如:
select getdate()
2004-09-12 11:06:08.177
找相關資料時發現有以下範例,節錄下來以備日後參考用。2004-09-12 11:06:08.177
select CONVERT(varchar, getdate(), 120 )
2004-09-12 11:06:08
2004-09-12 11:06:08
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')
20040912110608
20040912110608
select CONVERT(varchar(12) , getdate(), 111 )
2004/09/12
2004/09/12
select CONVERT(varchar(12) , getdate(), 112 )
20040912
20040912
select CONVERT(varchar(12) , getdate(), 102 )
2004.09.12
2004.09.12
select CONVERT(varchar(12) , getdate(), 101 )
09/12/2004
09/12/2004
select CONVERT(varchar(12) , getdate(), 103 )
12/09/2004
12/09/2004
select CONVERT(varchar(12) , getdate(), 104 )
12.09.2004
12.09.2004
select CONVERT(varchar(12) , getdate(), 105 )
12-09-2004
12-09-2004
select CONVERT(varchar(12) , getdate(), 106 )
12 09 2004
12 09 2004
select CONVERT(varchar(12) , getdate(), 107 )
09 12, 2004
09 12, 2004
select CONVERT(varchar(12) , getdate(), 108 )
11:06:08
11:06:08
select CONVERT(varchar(12) , getdate(), 109 )
09 12 2004 1
09 12 2004 1
select CONVERT(varchar(12) , getdate(), 110 )
09-12-2004
09-12-2004
select CONVERT(varchar(12) , getdate(), 113 )
12 09 2004 1
12 09 2004 1
select CONVERT(varchar(12) , getdate(), 114 )
11:06:08.177
11:06:08.177
Wholesale fashion watches designs and distributes Designer watches, Bvlgari Watches, Rolex Watches, and home furnishings as well, but their Cartier Handbags remain among their most well-known and sought-after Gucci Handbags. If you are looking for a reason to choose a Replica Handbags, you need look no further than the many celebrities who have chosen products designed by the teams of the Fendi Handbags.
發表評論
訂閱
上一篇
返回
下一篇
