Date::Date(int year, int month, int day, int hour, int minute) { setYear(year); setMonth(month); setDay(day); setHour(hour); setMinute(minute); }
Date::Date() { setYear( -1 ); setMonth( -1 ); setDay( -1 ); setHour( -1 ); setMinute( -1 ); }
Date::Date( int y, int mo, int d, int h, int mu ) { setYear(y); setMonth(mo); setDay(d); setHour(h); setMinute(mu); }
Date& Date::operator=( const Date& t ){ setYear( t.getYear() ); setMonth( t.getMonth() ); setDay( t.getDay() ); setHour( t.getHour() ); setMinute( t.getMinute() ); return *this; }
ZExport0 ZDateTime::ZDateTime (int aYear, int aMonth, int aDay, int aHour, int aMinute, int aSecond) { ZFUNCTRACE_DEVELOP ("ZDateTime::ZDateTime(int aYear, int aMonth, int aDay, int aHour, int aMinute, int aSecond)"); setYear (aYear); setMonth (aMonth); setDay (aDay); setHour (aHour); setMinute (aMinute); setSecond (aSecond); } // ZDateTime
void Clock::setSecond() { if (second == 59) { setMinute(); second = 0; } else { second++; } return; }
void Time::setTime( int hour, int minute) { try { setHour(hour); setMinute(minute); } catch(Time::HourException &h) { h.getMsg(); } catch(Time::MinuteException &m) { m.getMsg(); } }
Time::Time(int hour, int minute, int second){ setHour(hour); setMinute(minute); setSecond(second); }
// SETTERS // set new Time value using universal time void Time::setTime(int h, int m, int s) { setHour(h); setMinute(m); setSecond(s); }
bool Dec::setDec(float d, float m, float s) { if (setDegree(d) && setMinute(m) && setSecond(s)) return 1; return 0; }
/* Methods from the RA class */ bool RA::setRA(float h, float m, float s) { if (setHour(h) && setMinute(m) && setSecond(s)) return 1; return 0; }
/** * Method to set the time. No signal gets emitted during this method call * @param h The hour * @param m The minute. Minutes need to set by 5 minute steps */ void OTimePicker::setTime( int h, int m ) { setHour(h); setMinute(m); }
void cGameDate::fromString( const std::string& arg, eDateFormat format ) { LOGICAL success = false; if( !arg.empty() ) { UI32 start = 0; UI32 index = arg.find_first_of( dateSeparator ); switch( format ) { case YMD: if( index == start + 4 ) { setYear( (UI16) str2num( const_cast<char*>( arg.substr( start, 4 ).c_str() ) ) ); start = index + 1; index = arg.find_first_of( dateSeparator, start ); if( index == start + 2 ) { setMonth( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); start = index + 1; index = arg.find_first_of( dateTimeSeparator, start ); if( index == start + 2 ) { setDay( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); start = index + 1; index = arg.find_first_of( timeSeparator, start ); if( index == start + 2 ) { setHour( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); start = index + 1; setMinute( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); success = true; } } } } break; case DMY: if( index == start + 2 ) { setDay( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); start = index + 1; index = arg.find_first_of( dateSeparator, start ); if( index == start + 2 ) { setMonth( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); start = index + 1; index = arg.find_first_of( dateTimeSeparator, start ); if( index == start + 4 ) { setYear( (UI16) str2num( const_cast<char*>( arg.substr( start, 4 ).c_str() ) ) ); start = index + 1; index = arg.find_first_of( timeSeparator, start ); if( index == start + 2 ) { setHour( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); start = index + 1; setMinute( (UI08) str2num( const_cast<char*>( arg.substr( start, 2 ).c_str() ) ) ); success = true; } } } } break; } } if( !success ) setDefaultDate(); }