年月日
select year(current_timestamp),month(current_timestamp),day(current_timestamp)
,convert(varchar(10), getdate(),120)
时分秒 毫秒
select datepart(hh,getdate()),datepart(mi,getdate()),datepart(ss,getdate()),datepart(ms,getdate())
Convert to timestamp select datediff(s,'1970-01-01 08:00:00', current_timestamp)
timestamp to datetime
select dateadd(s,946656000,'1970-01-01 08:00:00')