本文整理汇总了C++中Timestamp::GetSeconds方法的典型用法代码示例。如果您正苦于以下问题:C++ Timestamp::GetSeconds方法的具体用法?C++ Timestamp::GetSeconds怎么用?C++ Timestamp::GetSeconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timestamp
的用法示例。
在下文中一共展示了Timestamp::GetSeconds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void SqlTestSuiteFixture::CheckSingleResult<Timestamp>(const char* request, const Timestamp& expected)
{
SQL_TIMESTAMP_STRUCT res;
CheckSingleResult0(request, SQL_C_TIMESTAMP, &res, 0, 0);
using ignite::impl::binary::BinaryUtils;
Timestamp actual = common::MakeTimestampGmt(res.year, res.month, res.day, res.hour, res.minute, res.second, res.fraction);
BOOST_REQUIRE_EQUAL(actual.GetSeconds(), expected.GetSeconds());
BOOST_REQUIRE_EQUAL(actual.GetSecondFraction(), expected.GetSecondFraction());
}
示例2: Compare
int Timestamp::Compare(const Timestamp &aCompare) const
{
uint64_t thisSeconds = GetSeconds();
uint64_t compareSeconds = aCompare.GetSeconds();
uint16_t thisTicks = GetTicks();
uint16_t compareTicks = aCompare.GetTicks();
int rval;
if (compareSeconds > thisSeconds)
{
rval = 1;
}
else if (compareSeconds < thisSeconds)
{
rval = -1;
}
else if (compareTicks > thisTicks)
{
rval = 1;
}
else if (compareTicks < thisTicks)
{
rval = -1;
}
else
{
rval = 0;
}
return rval;
}
示例3: WriteTimestamp
void BinaryUtils::WriteTimestamp(interop::InteropOutputStream* stream, const Timestamp val)
{
stream->WriteInt64(val.GetSeconds() * 1000);
stream->WriteInt32(val.GetSecondFraction());
}