日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

delphi的时间Ttime,Tdatetime的信息

發(fā)布時(shí)間:2023/12/20 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 delphi的时间Ttime,Tdatetime的信息 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

第一行 Ttime ?=now的值 ?timetostr時(shí)間顯示為15:08:50 ?雙浮點(diǎn)數(shù)double類型,8字節(jié)

? 小數(shù)點(diǎn)部分記錄時(shí)間 0.6311428009 *24=15.1474272216 ?取整為15, ?0.1474272216*60=8.845633296 取整8為分,

? ? ?0.845633296*60=50.73799776 取整為50為為秒,0.73799776*1000=737為毫秒。

? 這是時(shí)間的計(jì)算方法。


? ? 如果復(fù)制time,整數(shù)部分就為0了。


第三行 tDatetime ?now的,Datetimetostr時(shí)間顯示為2016-10-08 15:09:55,?雙浮點(diǎn)數(shù)double類型,8字節(jié)

? 小數(shù)點(diǎn)以后的表示的時(shí)間,如上計(jì)算。

? 整數(shù)部分,表示的日期。自1899-12-30后的天數(shù)。


Tdate就是去掉小數(shù)部分的內(nèi)容


網(wǎng)友:1:double數(shù)據(jù)類型是計(jì)算機(jī)四種基本類型之一,另外三個(gè)是:int,char,float 基本在每一種編程語言當(dāng)中都有的實(shí)現(xiàn)。 2:在delphi當(dāng)中double也是64位的。 3:c++當(dāng)中double也是64位, 4:兩種編程語言的double范圍都是一樣的


In Delphi, TDateTime is a type that maps to a Double. In C++, the TDateTime class corresponds to the Delphi TDateTime type. ?

The integral part of a Delphi TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of the TDateTime value is fraction of a 24 hour day that has elapsed. ?

Following are some examples of TDateTime values and their corresponding dates and times:

0 ? 12/30/1899 12:00 am ?
2.75 ? 1/1/1900 6:00 pm ?
-1.25 ? 12/29/1899 6:00 am ?
35065 ? 1/1/1996 12:00 am ?

To find the fractional number of days between two dates, simply subtract the two values, unless one of the TDateTime values is negative. Similarly, to increment a date and time value by a certain fractional number of days, add the fractional number to the date and time value if the TDateTime value is positive. ?

When working with negative TDateTime values, computations must handle time portion separately. The fractional part reflects the fraction of a 24-hour day without regard to the sign of the TDateTime value. For example, 6:00 am on 12/29/1899 is –1.25, not –1 + 0.25, which would be –0.75. There are no TDateTime values between –1 and 0.

Note:?Delphi 1.0 calculated the date from year 1 instead of from 1899. To convert a Delphi 1.0 date to a TDateTime value in later versions of the Delphi language, subtract 693594.0 from the Delphi 1.0 date. ?

總結(jié)

以上是生活随笔為你收集整理的delphi的时间Ttime,Tdatetime的信息的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。