0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c++ builder XE4, 10.2 Tokyo > TDateTime > SecondsBetween() > msecの違い

Last updated at Posted at 2015-06-19
動作確認
C++ Builder XE4

DateUtils.hppにはSecondsBetween()という関数がある。これは2つのTDateTime変数を比較する時、msec程度の違いであれば0になる (以下のdif)。

TDateTime dt1 = StrToDateTime(L"2015/06/19 08:59:59.001");
TDateTime dt2 = StrToDateTime(L"2015/06/19 09:00:00.000");
int dif = SecondsBetween(dt1, dt2);

ヘルプには以下のようにあった

9:00:00 A.M. と 9:00:00:999 A.M. の間の差を 0 としてレポートします。この差が 1 秒としてカウントされるには 1 ミリ秒足りないからです。

Tokyo

(追記 2017/12/26)

動作環境
Rad Studio 10.2 Tokyo Update 2

Tokyoでの動作が同じであることを確認した。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?