Date and Time

來源:互聯網
上載者:User

標籤:http   os   使用   ar   sp   時間   c   ef   sql   

Sql server 2005

datetime和smalldatetime 日期類型,用來表示一天的日期和時間。

datetime 範圍 1753年1月1日-9999年12月31日 精度 3.33毫秒

smalldatetime 範圍 1900年1月1日-2079年6月6日 精度 1分

備忘:

1.SQl Server用兩個4位元組的整數表示datetime.

第一個4位元組儲存基準日期之前或之後的天數。基準日期為1900-01-01,是系統的參照時間。

第二個4位元組儲存午夜之後的時間,精度是1/300。

datetime類型的值舍入到.000,.003,.007.

即(9,0,1⇒0)(2,3,4⇒3)(5,6,7,8⇒7)

2.smalldatetime表示的日期和時間沒有datetime精確。Sql Server 使用兩個2位元組的整數表示。

第一個2位元組儲存基準日期之前或之後的天數

第二個2位元組儲存午夜之後的分鐘數。

smalldatetime類型的值

≧29.99 向下舍入到最近的分鐘

≦29.98 向上舍入到最近的分鐘

 

Date and Time

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.