当前位置: 首页>>代码示例>>C++>>正文


C++ TDateTime::Day方法代码示例

本文整理汇总了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;
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:28,代码来源:alfexcalendarengine.cpp

示例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()));
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:10,代码来源:t_httphdr.cpp

示例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;
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:28,代码来源:time.cpp

示例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() );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:11,代码来源:prescondvalidity.cpp

示例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;
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:37,代码来源:capinfo.cpp

示例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() );
    }
开发者ID:RomanSaveljev,项目名称:osrndtools,代码行数:7,代码来源:MemSpyEngineUtils.cpp

示例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();
	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:47,代码来源:testimpbday.cpp

示例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;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:20,代码来源:alfexcalendarengine.cpp

示例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;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:21,代码来源:alfexcalendarengine.cpp

示例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);

}
开发者ID:ykasidit,项目名称:AzqGenUtils,代码行数:9,代码来源:AzenqosEngineUtils.cpp

示例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;
		}	
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:19,代码来源:testexbdaylocal.cpp

示例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);
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:21,代码来源:Chinese.cpp

示例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;
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:12,代码来源:MemSpyEngineOutputSink.cpp

示例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 );
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:14,代码来源:MemSpyEngineOutputSink.cpp

示例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;
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:25,代码来源:CZipCompressor.cpp


注:本文中的TDateTime::Day方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。