Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In case you're curious, the TDateTime is encoded as floating point <code>Double</code> internally. </p> <p><strong>TDateTime internals</strong><br> The fractional part denotes the time, the integer part denotes the date.<br> Knowing this the following tests will evaluate to <code>true</code>.</p> <pre><code>dtTime: ABS(Double(DateTime1)) &lt; 1.0 dtDate: Trunc(Double(DateTime1)) = Double(DateTime1) dtDateTime: ( (ABS(Double(DateTime1)) &gt; 1.0) and (Trunc(Double(DateTime1)) &lt;&gt; Double(DateTime1)) ) </code></pre> <p>Obviously that's a very roundabout way of testing, but sometimes it helps to know how a TDateTime is shaped internally. </p> <p><strong>DateUtils</strong><br> The sane versions of these tests would be: </p> <pre><code>uses DateUtils; dtDate: DateTime1 = DateOf(DateTime1) dtTime: DateTime1 = TimeOf(DateTime1) dtDateTime:(DateTime1 &lt;&gt; DateOf(DateTime1)) and (DateTime1 &lt;&gt; TimeOf(DateTime1)) </code></pre> <p><strong>TDateTime is compatible with Excel</strong><br> The value <code>0</code> links to the epoch in Microsoft's Excel: 30 December 1899; 12:00 A.M.<br> <em><sup>(It should have been 1-1-1900, but they changed it to compensate for an error in Lotus' 123 date algorithm)</sup></em><br> This is great, because Delphi's <code>TDateTime</code> is fully compatible with Excel's DateTime. </p> <p>Here's the official doc: <a href="http://docwiki.embarcadero.com/Libraries/XE5//en/System.TDateTime" rel="nofollow">http://docwiki.embarcadero.com/Libraries/XE5//en/System.TDateTime</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload