本文整理汇总了C++中CDateTime::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CDateTime::getTime方法的具体用法?C++ CDateTime::getTime怎么用?C++ CDateTime::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDateTime
的用法示例。
在下文中一共展示了CDateTime::getTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
// Write instance of the CDateTime class into the given writer.
static void show(IWriter& writer, const CDateTime& a_crDateTime)
{ CALL
writer << fill_0 << width(2) << a_crDateTime.getDate().getDay() << STR('.');
writer << fill_0 << width(2) << a_crDateTime.getDate().getMonth() << STR('.');
writer << fill_0 << width(4) << a_crDateTime.getDate().getYear() << STR(' ');
writer << fill_0 << width(2) << a_crDateTime.getTime().getHour() << STR(':');
writer << fill_0 << width(2) << a_crDateTime.getTime().getMinute() << STR(':');
writer << fill_0 << width(2) << a_crDateTime.getTime().getSecond() << STR('-');
writer << fill_0 << width(4) << a_crDateTime.getTime().getMillisecond() << ln;
}
示例2: initDefaultValues
void MessageGenerator::initDefaultValues()
{
char dbuf[64];
CDateTime now;
now.setNow();
StringBuffer nowstr;
now.getString(nowstr, true);
unsigned y, m, d;
now.getDate(y, m, d, true);
unsigned h, minute, s, nano;
now.getTime(h, minute, s, nano, true);
m_defaultvalues["string"] = "string";
m_defaultvalues["boolean"] = "1";
m_defaultvalues["decimal"] = "3.1415926535897932384626433832795";
m_defaultvalues["float"] = "3.14159";
m_defaultvalues["double"] = "3.14159265358979";
m_defaultvalues["duration"] = "P1Y2M3DT10H30M";
m_defaultvalues["dateTime"] = nowstr.str();
sprintf(dbuf, "%02d:%02d:%02d", h,minute,s);
m_defaultvalues["time"] = dbuf;
sprintf(dbuf, "%04d-%02d-%02d", y, m, d);
m_defaultvalues["date"] = dbuf;
sprintf(dbuf, "%04d-%02d", y, m);
m_defaultvalues["gYearMonth"] = dbuf;
sprintf(dbuf, "%04d", y);
m_defaultvalues["gYear"] = dbuf;
sprintf(dbuf, "--%02d-%02d", m, d);
m_defaultvalues["gMonthDay"] = dbuf;
sprintf(dbuf, "---%02d", d);
m_defaultvalues["gDay"] = dbuf;
sprintf(dbuf, "--%02d--", m);
m_defaultvalues["gMonth"] = dbuf;
m_defaultvalues["hexBinary"] = "A9D4C56EFB";
m_defaultvalues["base64Binary"] = "YmFzZTY0QmluYXJ5";
m_defaultvalues["anyURI"] = "http://anyURI/";
m_defaultvalues["QName"] = "q:name";
m_defaultvalues["NOTATION"] = "NOTATION";
m_defaultvalues["normalizedString"] = "normalizedString";
m_defaultvalues["token"] = "token";
m_defaultvalues["language"] = "en-us";
m_defaultvalues["integer"] = "0";
m_defaultvalues["nonPositiveInteger"] = "-1";
m_defaultvalues["negativeInteger"] = "-2";
m_defaultvalues["long"] = "2147483647";
m_defaultvalues["int"] = "32716";
m_defaultvalues["short"] = "4096";
m_defaultvalues["byte"] = "127";
m_defaultvalues["nonNegativeInteger"] = "3";
m_defaultvalues["positiveInteger"] = "2";
m_defaultvalues["unsignedLong"] = "4294967295";
m_defaultvalues["unsignedInt"] = "4";
m_defaultvalues["unsignedShort"] = "65535";
m_defaultvalues["unsignedByte"] = "255";
}
示例3: getWUIDonDate
static StringBuffer &getWUIDdaysAgo(StringBuffer &wuid,int daysago)
{
CDateTime dt;
dt.setNow();
dt.adjustTime(-(daysago*60*24));
unsigned y;
unsigned m;
unsigned d;
dt.getDate(y,m,d, true);
unsigned h;
unsigned mn;
unsigned s;
unsigned ns;
dt.getTime(h,mn,s,ns,true);
return getWUIDonDate(wuid,y,m,d,h,mn);
}