#include "mytime.h"
#include<iomanip>
#include<iostream>
using namespace std;
MyTime::MyTime()
{
this->hour=0;
this->minue=0;
}
MyTime::MyTime(int h,int m){
this->hour=h;
this->minue=m;
MyTime::normalizeTime();
}
void MyTime::setTime(int h,int m){
this->hour=h;
this->minue=m;
MyTime::normalizeTime();
}
void MyTime::output()
{
cout<<setfill('0')<<setw(2)<<hour<<":"<<setfill('0')<<setw(2)<<minue<<endl;
}
int MyTime::getHour()
{
return this->hour;
}
int MyTime::getMinue()
{
return this->minue;
}
int MyTime::getTotalMinutes()
{
return 60*this->hour+this->minue;
}
void MyTime::normalizeTime()
{
if(this->hour>23)
this->hour=this->hour%24;
if(this->minue>59)
this->hour+=this->minue/60;
this->minue=this->minue%60;
}