//plus Time Space
if (xunit=="Seconds") {
ss=ss+sp;
}
if (xunit=="Minutes") {
smm=smm+sp;
}
if (xunit=="Hours") {
sh=sh+sp;
}
if(ss>=60) {
//set second when it>60
ss=ss%60;
smm++;
}
if (smm>=60){
//set minute when it>60
ss=ss%60;
smm=smm%60;
sh++;
}
if (sh>=24){
//set hour when it>60
ss=ss%60;
smm=smm%60;
sh=sh%24;
sd++;
}
if (sd==29 && sy%4!=0 && sm==2){
//Feb
sd=1;
sm++;
}
if (sd==30 && sy%4==0 && sm==2){
//Feb
sd=1;
sm++;
}
if (sd==31 && (sm==4 || sm==6 || sm==9 || sm==11)){
//30days, Month+1
sd=1;
sm++;
}
if (sd==32 && (sm==3 || sm==5 || sm==7 || sm==8 || sm==10 || sm==12)){ //31days, Month+1
sd=1;
sm++;
}
if (sm==13){
//Year+1
sm=1;
sy++;
}