Clock having time dilation

int aday = 2;

int aday2 = 3;
int aday3 = 4;
int aday4 = 5;
int aday5 = 6;
int aday6 = 9;
int aday7 = 10;
int aday8 = 11;
int aday9 = 12;
int aday10 = 13;
int aday11 = 16;
int aday12 = 17;
int aday13 = 18;
int aday14 = 19;
int aday15 = 20;
int aday16 = 23;
int aday17 = 24;
int aday18 = 25;
int aday19 = 26;
int aday20 = 27;
int aday21 = 28;
int amonth = 4;
int ayear = 2018;

Are you trying to make an alarm which sounds only on weekdays? If so:

  • April 28 is not a weekday: it is a Saturday.
  • You forgot Monday, April 30.
  • What will you do once April is over?
  • There are easier ways to get at the day of the week.
int yearday = 0;
int weekday = 0;

// This next part figures out the day of the year.
// We number the days of the year from 1 to 365.
yearday = day;
if (month > 1)  yearday = yearday + 31;
if (month > 2)  yearday = yearday + 28; // TODO: take care of leap years!
if (month > 3)  yearday = yearday + 31;
if (month > 4)  yearday = yearday + 30;
if (month > 5)  yearday = yearday + 31;
if (month > 6)  yearday = yearday + 30;
if (month > 7)  yearday = yearday + 31;
if (month > 8)  yearday = yearday + 31;
if (month > 9)  yearday = yearday + 30;
if (month > 10) yearday = yearday + 31;
if (month > 11) yearday = yearday + 30;


// This next part assumes that the year begins on a Monday.
// It will work all right for 2018, which indeed began on a Monday.
// To work with other years, it will need to be changed.
// We are numbering the days of the week as follows:
// Monday is day 1, Tuesday is day 2, and so forth. Sunday is day 7.
// Because the year 2018 began on a Monday, we start by doing this:
weekday = yearday;
// For the first seven days of the year 2018, this will suffice.
// (That is because day 1 of the year 2018 falls on day 1 of the week, etc.)
// But as soon as we get to day 8 of the year and beyond, we get garbage.
// (After all, a week has only 7 days!)
// Here is how we clean up the garbage:
while (weekday > 7) {
  weekday = weekday - 7;
}
// What that does is, it subtracts 7 days (one whole week) at a time
// until it gets a number in the range 1 through 7.
// Because of the "while" keyword, it will keep subtracting
// until our number is small enough.

Then, for the alarm, don't check the value of day. Check the value of weekday.