本文整理汇总了C++中Timestamp::GetTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Timestamp::GetTime方法的具体用法?C++ Timestamp::GetTime怎么用?C++ Timestamp::GetTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timestamp
的用法示例。
在下文中一共展示了Timestamp::GetTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setFromStatement
void setFromStatement(TsSqlVariant &variant, void *statement, int col)
{
using namespace IBPP;
Statement &st = *reinterpret_cast<Statement*>(statement);
switch(st->ColumnType(col))
{
case sdBlob:
{
Blob b = BlobFactory(st->DatabasePtr(), st->TransactionPtr());
if (st->Get(col, b))
variant.setNull();
else
{
std::string temp;
b->Load(temp);
variant.setVariant(QVariant(QString::fromStdString(temp)));
}
break;
}
case sdDate:
{
Date d;
if (st->Get(col, d))
variant.setNull();
else
{
int year, month, day;
d.GetDate(year, month, day);
variant.setVariant(QVariant(QDate(year, month, day)));
}
break;
}
case sdTime:
{
Time d;
if (st->Get(col, d))
variant.setNull();
else
{
int hour, minute, second, msec;
d.GetTime(hour, minute, second, msec);
variant.setVariant(QVariant(QTime(hour, minute, second, msec)));
}
break;
}
case sdTimestamp:
{
Timestamp d;
if (st->Get(col, d))
variant.setNull();
else
{
int year, month, day, hour, minute, second, msec;
d.GetTime(hour, minute, second, msec);
d.GetDate(year, month, day);
variant.setVariant(
QVariant(QDateTime(
QDate(year, month, day),
QTime(hour, minute, second, msec))));
}
break;
}
case sdString:
{
std::string temp;
if (st->Get(col, temp))
variant.setNull();
else
variant.setVariant(QVariant(QString::fromStdString(temp)));
break;
}
case sdSmallint:
{
TsSqlSmallInt temp;
if (st->Get(col, temp))
variant.setNull();
else
variant.setVariant(QVariant(temp));
break;
}
case sdInteger:
{
TsSqlInt temp;
if (st->Get(col, temp))
variant.setNull();
else
variant.setVariant(QVariant(temp));
break;
}
case sdLargeint:
{
TsSqlLargeInt temp;
if (st->Get(col, temp))
variant.setNull();
else
variant.setVariant(QVariant(temp));
break;
}
case sdFloat:
{
//.........这里部分代码省略.........