Beispiel #1
0
void Value_date_imp::Init( void ) 
{
	// Used in tests only so make it just for our datetime parser be happy.
	put_Day(1);
	put_Month(1);
	put_Year(1);
}
void Value_datetime_imp::Init( void ) 
{
	// Used in tests only so make it just for our datetime parser be happy.
	put_Day(1);
	put_Month(1);
	put_Year(1);
	put_Hours(0);
	put_Minutes(0);
	put_Seconds(0);
	put_Milliseconds(1);
}
Beispiel #3
0
void Value_date_imp::Increment( void ) 
{
	// Used in tests only so make it just for our datetime parser be happy.

	if( mValue == 0 )
	{
		Init();
		return;
	}


	vuint16 day = get_Day();
	vuint16 month = get_Month();
	vint32 year = get_Year();

	if( day < 31 )
	{
		put_Day( ++day );
	}
	else if( month < 12 )
	{	
		put_Day( 1 );
		put_Month( ++month );
	}
	else if( year < 9999 )
	{		
		put_Day(1);
		put_Month(1);
		put_Year( ++year );
	}
	else
	{
		// no nore date which makes parser happy. Actually we rarelly get here.
		Init();
	}
}
void Value_datetime_imp::Increment( void ) 
{
	// Used in tests only so make it just for our datetime parser be happy.
	if( mValue == 0 )
	{
		Init();
		return;
	}

	vuint16 day = get_Day();
	vuint16 month = get_Month();
	vint32 year = get_Year();
	vuint16 hours = get_Hours();
	vuint16 minutes = get_Minutes();
	vuint16 seconds = get_Seconds();
	vuint16 ms = get_Milliseconds();

	if( ms < 999 )
	{
		put_Milliseconds( ++ms );
	}
	else if( seconds < 59 )
	{
		put_Milliseconds(1);
		put_Seconds( ++seconds );
	}
	else if( minutes < 59 )
	{
		put_Milliseconds(1);
		put_Seconds(0);
		put_Minutes( ++minutes );
	}
	else if( hours < 24 )
	{
		put_Milliseconds(1);
		put_Seconds(0);
		put_Minutes(0);
		put_Hours( ++hours );
	}
	else
	{
		// no nore time which makes parser happy. Actually we rarelly get here.

		if( day < 31 )
		{
			put_Day( ++day );
		}
		else if( month < 12 )
		{	
			put_Day( 1 );
			put_Month( ++month );
		}
		else if( year < 9999 )
		{		
			put_Day(1);
			put_Month(1);
			put_Year( ++year );
		}
		else
		{
			// no nore date which makes parser happy. Actually we rarelly get here.
			Init();
		}
	}
}