本文整理汇总了C++中TDateTime::Day方法的典型用法代码示例。如果您正苦于以下问题:C++ TDateTime::Day方法的具体用法?C++ TDateTime::Day怎么用?C++ TDateTime::Day使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDateTime
的用法示例。
在下文中一共展示了TDateTime::Day方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEventInformation
// ----------------------------------------------------
// CAlfExCalendarEngine::NumberOfEvents
// ----------------------------------------------------
void CAlfExCalendarEngine::GetEventInformation(
const TTime& aDate,
TInt aIndex,
TDes& aTextBuffer)
{
aTextBuffer.Zero();
TInt count = KErrNotFound;
TDateTime requestedDate = aDate.DateTime();
const TInt arrayCount = iCalendarEventArray.Count();
for(TInt loop = 0; loop < arrayCount; loop++ )
{
TDateTime eventDate = iCalendarEventArray[loop].iItemDay.DateTime();
if(eventDate.Day() == requestedDate.Day() &&
eventDate.Month() == requestedDate.Month() &&
eventDate.Year() == requestedDate.Year())
{
count++;
}
if(aIndex == count)
{
aTextBuffer.Copy(iCalendarEventArray[loop].iItemText);
loop = arrayCount;
}
}
}
示例2: CompareDate
TBool CHttpHdrTest::CompareDate(TDateTime aDate1, TDateTime aDate2)
{
return ((aDate1.Year() == aDate2.Year()) &&
(aDate1.Month() == aDate2.Month()) &&
(aDate1.Day() == aDate2.Day()) &&
(aDate1.Hour() == aDate2.Hour()) &&
(aDate1.Minute() == aDate2.Minute()) &&
(aDate1.Second() == aDate2.Second()) &&
(aDate1.MicroSecond() == aDate2.MicroSecond()));
}
示例3: TTimeIntervalSeconds
static struct tm& as_struct_tm (const time_t& t, struct tm& res)
{
TTime us = UNIX_BASE + TTimeIntervalSeconds(t);
TDateTime dt = us.DateTime();
res.tm_sec = dt.Second();
res.tm_min = dt.Minute();
res.tm_hour = dt.Hour();
res.tm_mday = dt.Day() + 1;
res.tm_mon = dt.Month();
res.tm_year = dt.Year() - 1900;
// EPOC32 counts the year day as Jan 1st == day 1
res.tm_yday = us.DayNoInYear() - 1;
// EPOC32 counts the weekdays from 0==Monday to 6==Sunday
res.tm_wday = us.DayNoInWeek() + 1;
if (res.tm_wday==7)
res.tm_wday=0; // Sunday==0 in a struct tm
// newlib just sets this field to -1
// tm_isdst doesn't really make sense here since we don't
// know the locale for which to interpret this time.
res.tm_isdst = -1;
return res;
}
示例4: LogDateTime
// ---------------------------------------------------------------------------
// TPresCondValidity::LogDateTime()
// ---------------------------------------------------------------------------
//
void TPresCondValidity::LogDateTime(TDateTime aDateTime)
{
OPENG_DP(D_OPENG_LIT( " %d, %d, %d, %d, %d, %d, %d"),
aDateTime.Year(), aDateTime.Month()+1, aDateTime.Day()+1,
aDateTime.Hour(), aDateTime.Minute(), aDateTime.Second(),
aDateTime.MicroSecond() );
}
示例5: WriteSolutionTagL
// -----------------------------------------------------------------------------
// CCapInfo::WriteSolutionTagL()
// Writes SyncSolutionsService solution data to capability object.
// -----------------------------------------------------------------------------
//
void CCapInfo::WriteSolutionTagL( const TDesC& aContentName,
const TSConSolutionInfo& aSolution )
{
TRACE_FUNC_ENTRY;
_LIT( KFormatUID, "UID=0x%08x" );
_LIT( KFormatName, "Name=%S" );
_LIT( KFormatDate, "Timestamp=%04d%02d%02dT%02d%02d%02dZ" );
WriteTagL( EExt, TXmlParser::EElementBegin );
WriteValueL( EXNam, aContentName );
TFileName temp;
temp.Format( KFormatUID, aSolution.iUid );
WriteValueL( EXVal, temp );
temp.Format( KFormatName, &aSolution.iSolutionName );
WriteValueL( EXVal, temp );
if ( aSolution.iTime.Int64() != 0 )
{
// write time
TDateTime time = aSolution.iTime.DateTime();
temp.Format( KFormatDate, time.Year(), time.Month() + 1,
time.Day() + 1, time.Hour(), time.Minute(), time.Second() );
WriteValueL( EXVal, temp );
}
WriteTagL( EExt, TXmlParser::EElementEnd );
TRACE_FUNC_EXIT;
}
示例6: FormatTimeSimple
void MemSpyEngineUtils::FormatTimeSimple( TDes& aBuf, const TTime& aTime )
{
const TDateTime dt = aTime.DateTime();
//
_LIT( KTimeFormatSpec, "%04d%02d%02d %02d:%02d:%02d" );
aBuf.Format( KTimeFormatSpec, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second() );
}
示例7: doTestStepL
TVerdict CTestImpBDay::doTestStepL()
/**
* @return - TVerdict code
* Override of base class pure virtual
*/
{
SetTestStepResult(EFail);
TInt numberOfCases = 0;
while(ETrue)
{
TBuf<90> config(KImportBDay);
TPtrC ptrexpUTC = GetExpectedUTCFromIniL(numberOfCases, config, ETrue);
if(ptrexpUTC==KNullDesC)
{
break;
}
INFO_PRINTF2(_L("TEST: %d"), numberOfCases+1);
iExpectedBDay = FormatDateTime(ptrexpUTC);
TBuf<90> pathVCF(KPathImportBDay);
OpenBDAYVCFAndImportItemL(pathVCF, numberOfCases); // Imports vcf
TDateTime importedDateTime = iBDayFromImport.DateTime();
TDateTime expectedDateTime = iExpectedBDay.DateTime();
// If birthday does not match, test will fail
if((importedDateTime.Year() != expectedDateTime.Year()) ||
(importedDateTime.Month() != expectedDateTime.Month()) ||
(importedDateTime.Day() != expectedDateTime.Day()) )
{
INFO_PRINTF1(_L("Imported Birthday not correct"));
SetTestStepResult(EFail);
return TestStepResult();
}
else
{
INFO_PRINTF1(_L("Imported Birthday as expected"));
SetTestStepResult(EPass);
}
numberOfCases++;
}
return TestStepResult();
}
示例8: NumberOfEvents
// ----------------------------------------------------
// CAlfExCalendarEngine::NumberOfEvents
// ----------------------------------------------------
TInt CAlfExCalendarEngine::NumberOfEvents(const TTime& aDate)
{
TInt count = 0;
TDateTime requestedDate = aDate.DateTime();
const TInt arrayCount = iCalendarEventArray.Count();
for(TInt loop = 0; loop < arrayCount; loop++)
{
TDateTime eventDate = iCalendarEventArray[loop].iItemDay.DateTime();
if(eventDate.Day() == requestedDate.Day() &&
eventDate.Month() == requestedDate.Month() &&
eventDate.Year() == requestedDate.Year())
{
count++;
}
}
return count;
}
示例9: EventsAvailable
// ----------------------------------------------------
// CAlfExCalendarEngine::EventsAvailable
// ----------------------------------------------------
TBool CAlfExCalendarEngine::EventsAvailable(const TTime& aDate)
{
TBool ret( EFalse );
TDateTime requestedDate = aDate.DateTime();
const TInt arrayCount = iCalendarEventArray.Count();
for(TInt loop = 0; loop < arrayCount; loop++)
{
TDateTime eventDate = iCalendarEventArray[loop].iItemDay.DateTime();
if(eventDate.Day() == requestedDate.Day() &&
eventDate.Month() == requestedDate.Month() &&
eventDate.Year() == requestedDate.Year())
{
ret = ETrue;
break;
}
}
return ret;
}
示例10: MakeTimeStrMilli
void TAzenqosEngineUtils::MakeTimeStrMilli(TTime &time,TDes& str) //str should be at least 19 in length
{
const TInt KThousand = 1000;
TDateTime date = time.DateTime();
str.Format(KTimeStampMillisecFormat,date.Year()%2000,date.Month()+1,date.Day()+1,date.Hour(),date.Minute(),date.Second(),date.MicroSecond()*KThousand);
}
示例11: CheckImportedBDay
TBool CTestExBDayLocal::CheckImportedBDay()
{
TDateTime importedDateTime = iBDayFromImport.DateTime();
TDateTime exportedDateTime = iBDayLocal.DateTime();
//checks if exported and imported birthday macthes, which it should, otherwise test failed
if((importedDateTime.Year() != exportedDateTime.Year()) ||
(importedDateTime.Month() != exportedDateTime.Month()) ||
(importedDateTime.Day() != exportedDateTime.Day()) )
{
INFO_PRINTF1(_L("Export and Import of birthday does not match (incorrect)"));
return EFalse;
}
else
{
INFO_PRINTF1(_L("Export and Import of birthday macthes (correct)"));
return ETrue;
}
}
示例12: DateTimeToChinese
//------------------------------------------------------
// Class: TChineseCalendar
// Function: DateTimeToChinese
// Arguments: TDateTime &
//
// Comments: Sets the date held in the given TDateTime
// class to the TChineseCalendar class
//
// Return: void
//------------------------------------------------------
EXPORT_C void TChineseCalendar::DateTimeToChinese(const TDateTime &aDT)
{
TArithmeticalDate gregDate;
TGregorianCalendar greg;
gregDate.iDay = aDT.Day() + KCalConvMonthOffsetByOne;
gregDate.iMonth = (TInt)aDT.Month() + KCalConvMonthOffsetByOne;
gregDate.iYear = aDT.Year();
iJulianDay = greg.GregToJulianDay(gregDate);
}
示例13: DataStreamTimeStampBeginL
EXPORT_C void CMemSpyEngineOutputSink::DataStreamTimeStampBeginL( const TTime& aTime )
{
const TDateTime dt( aTime.DateTime() );
// Build it up...
HBufC* spec = HBufC::NewL( KMaxFileName );
TPtr pName( spec->Des() );
pName.Format( KMemSpyDataStreamFolderNameFormatSpec, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second());
DataStreamTimeStampEnd();
iDataStreamTimeStampSpecifier = spec;
}
示例14: ConstructL
void CMemSpyEngineSinkMetaData::ConstructL( const TDesC& aRoot, const TDesC& aContext, const TDesC& aFolder, const TDesC& aExtension, const TTime& aFolderTime )
{
iRoot = aRoot.AllocL();
iContext = aContext.AllocL();
iFolder = aFolder.AllocL();
iExtension = aExtension.AllocL();
const TDateTime dt = aFolderTime.DateTime();
HBufC* spec = HBufC::NewLC( KMaxFileName );
TPtr pName( spec->Des() );
pName.Format( KMemSpyDataStreamFolderNameFormatSpec, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second());
iFolderTimeStamp = pName.AllocL();
CleanupStack::PopAndDestroy( spec );
}
示例15: MsDosDateTime
/*
-----------------------------------------------------------------------
-----------------------------------------------------------------------
*/
TUint32 CZipCompressor::MsDosDateTime( TTime aTime )
{
TDateTime dateTime = aTime.DateTime();
TUint8 day = dateTime.Day() + 1;
TUint8 month = dateTime.Month() + 1;
TUint8 year = dateTime.Year() - 1980;
TUint8 seconds = dateTime.Second();
TUint8 minutes = dateTime.Minute();
TUint8 hours = dateTime.Hour();
TUint32 date = 0;
date |= ( year & 0x3f ) << 9;
date |= ( month & 0x0f ) << 5;
date |= ( day & 0x1f );
date <<= 16;
date |= ( hours & 0x1f ) << 11;
date |= minutes << 5;
date |= seconds >> 1;
return date;
}