本文整理汇总了C++中DateComponents::hour方法的典型用法代码示例。如果您正苦于以下问题:C++ DateComponents::hour方法的具体用法?C++ DateComponents::hour怎么用?C++ DateComponents::hour使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateComponents
的用法示例。
在下文中一共展示了DateComponents::hour方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateMHTMLHeader
void MHTMLArchive::generateMHTMLHeader(
const String& boundary, const String& title, const String& mimeType,
SharedBuffer& outputBuffer)
{
DateComponents now;
now.setMillisecondsSinceEpochForDateTime(currentTimeMS());
// TODO(lukasza): Passing individual date/time components seems fragile.
String dateString = makeRFC2822DateString(
now.weekDay(), now.monthDay(), now.month(), now.fullYear(),
now.hour(), now.minute(), now.second(), 0);
StringBuilder stringBuilder;
stringBuilder.appendLiteral("From: <Saved by Blink>\r\n");
stringBuilder.appendLiteral("Subject: ");
// We replace non ASCII characters with '?' characters to match IE's behavior.
stringBuilder.append(replaceNonPrintableCharacters(title));
stringBuilder.appendLiteral("\r\nDate: ");
stringBuilder.append(dateString);
stringBuilder.appendLiteral("\r\nMIME-Version: 1.0\r\n");
stringBuilder.appendLiteral("Content-Type: multipart/related;\r\n");
stringBuilder.appendLiteral("\ttype=\"");
stringBuilder.append(mimeType);
stringBuilder.appendLiteral("\";\r\n");
stringBuilder.appendLiteral("\tboundary=\"");
stringBuilder.append(boundary);
stringBuilder.appendLiteral("\"\r\n\r\n");
// We use utf8() below instead of ascii() as ascii() replaces CRLFs with ??
// (we still only have put ASCII characters in it).
ASSERT(stringBuilder.toString().containsOnlyASCII());
CString asciiString = stringBuilder.toString().utf8();
outputBuffer.append(asciiString.data(), asciiString.length());
}
示例2: shouldHourFieldDisabled
bool DateTimeEditBuilder::shouldHourFieldDisabled() const
{
if (m_hour23Range.isSingleton() && m_hour23Range.minimum == m_dateValue.hour()
&& !(shouldMinuteFieldDisabled() && shouldSecondFieldDisabled() && shouldMillisecondFieldDisabled()))
return true;
if (m_dateValue.type() == DateComponents::Time)
return false;
ASSERT(m_dateValue.type() == DateComponents::DateTimeLocal);
if (shouldDayOfMonthFieldDisabled()) {
ASSERT(m_parameters.minimum.fullYear() == m_parameters.maximum.fullYear());
ASSERT(m_parameters.minimum.month() == m_parameters.maximum.month());
return false;
}
const Decimal decimalMsPerDay(static_cast<int>(msPerDay));
Decimal hourPartOfMinimum = (stepRange().stepBase().abs().remainder(decimalMsPerDay) / static_cast<int>(msPerHour)).floor();
return hourPartOfMinimum == m_dateValue.hour() && stepRange().step().remainder(decimalMsPerDay).isZero();
}
示例3: setValueAsDate
void DateTimeAMPMFieldElement::setValueAsDate(const DateComponents& date)
{
setValueAsInteger(date.hour() >= 12 ? 1 : 0);
}
示例4: shouldAMPMFieldDisabled
bool DateTimeEditBuilder::shouldAMPMFieldDisabled() const
{
return shouldHourFieldDisabled()
|| (m_hour23Range.minimum < 12 && m_hour23Range.maximum < 12 && m_dateValue.hour() < 12)
|| (m_hour23Range.minimum >= 12 && m_hour23Range.maximum >= 12 && m_dateValue.hour() >= 12);
}