Millis not working

I'm working on making an alarm clock using an RTC chip, after the alarm has been disabled I want it to reset after a minute as passed from the time the alarm turned off. The alarm is turned off via registering a distance of 20cm by an ultrasonic sensor. I read about the millis function so I tried to implement it. But I'm having some issues. My whole code is pretty long and messy so I'm going to post a small excerpt of what I'm implementing.

unsigned long alarmtime_past = 0;
unsigned long alarmtime_current = millis();



if (hour_check == alarm_hour && minute_check == alarm_min && (alarm_switch == 2 || alarm_switch == 1)){
alarm();
alarm_switch = 1;
}


if (alarm_switch == 1 && cm < 20){
alarmoff();
alarm_switch = 0;
alarmtime_past = alarmtime_current;
}

if(alarm_switch == 1 && abs(alarmtime_current - alarmtime_past) >= 60000){
alarm_switch = 2;

When I monitor the variable alarmtime_current and alarmtime_past on my serial monitor I get 0 for both. Not sure why, hopefully you guys can tell me.

I also use millis inside two interrupt functions for button debounce. Please let me know if you need to see more code.

Here's the code, I have to paste it in parts since it's a long sketch. Sorry for the mess just wanted to get everything working before cleaning it up a bit. I have used your suggestion to take out absolute out thank you, if you see anything else let me know. I'm fairly new to arduino.

Part 1/2:

/*
  LCD WIRING

 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 7
 * LCD D5 pin to digital pin 6
 * LCD D6 pin to digital pin 5
 * LCD D7 pin to digital pin 4
 * LCD R/W pin to ground
 * LCD VSS pin to ground
 * LCD VCC/VDD pin to 5V
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 9)
*/

#include <LiquidCrystal.h>
#include "Wire.h"
#define DS3231_I2C_ADDRESS 0X68

////// LCD PART //////
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);

/////// RTC CHIP ///////
// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
  return( (val/10*16) + (val%10) );
}
// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
  return( (val/16*10) + (val%16) );
}

// Sets the time with the given arguments
void setDS3231time(byte second, byte minute, byte hour)
{
  // sets time and date data to DS3231
  Wire.beginTransmission(DS3231_I2C_ADDRESS);
  Wire.write(0); // set next input to start at the seconds register
  Wire.write(decToBcd(second)); // set seconds
  Wire.write(decToBcd(minute)); // set minutes
  Wire.write(decToBcd(hour)); // set hours
  Wire.endTransmission();
}

// Reads the time from the device
void readDS3231time(byte *second,
    byte *minute,
    byte *hour)
{
  Wire.beginTransmission(DS3231_I2C_ADDRESS);
  Wire.write(0); // set DS3231 register pointer to 00h
  Wire.endTransmission();
  Wire.requestFrom(DS3231_I2C_ADDRESS, 7);
  // request seven bytes of data from DS3231 starting from register 00h
  *second = bcdToDec(Wire.read() & 0x7f);
  *minute = bcdToDec(Wire.read());
  *hour = bcdToDec(Wire.read() & 0x3f);
}

// Display time on the LCD
void displayLCDTime(){
  byte second, minute, hour; 
  // retrieve data from DS3231
  readDS3231time(&second, &minute, &hour);

  if(hour > 9){
    lcd.setCursor(0, 0);
  } else {
    lcd.setCursor(1,0); 
   }
  lcd.print(hour);
  lcd.setCursor(2,0); 
  lcd.print(":"); 
  lcd.setCursor(3,0); 
  
  if (minute < 10){
  lcd.print("0");
  lcd.setCursor(4,0);
  lcd.print(minute);
  }
  else{
  lcd.print(minute); 
  }

}


// CHANGE MODES

int mode  = 3;
int lcdmode = 3;

void modechange()
{
 static unsigned long last_interrupt_time = 0;
 unsigned long interrupt_time = millis();
 // If interrupts come faster than 200ms, assume it's a bounce and ignore
 if (interrupt_time - last_interrupt_time > 700) 
 {
   if (mode == 1){
    mode = 2;
   }
   else if (mode == 2){
    mode = 3;
   }
   else if (mode == 3 ){
    mode = 4;
   }
  else if (mode == 4){
    mode = 1;
  }
   }
 
 last_interrupt_time = interrupt_time;
}

////// SETTING TIME ////

// Setting hour
const int hourpin = A1;
int hourvalue;
int hourmin = 1023;
int hourmax = 0;
byte CLOCK_HOUR; // passed to RTC
int clock_hour;
int alarm_hour;

// Setting minutes
const int minutepin = A0;
int minutevalue;
int minutemin = 1023;
int minutemax = 0;
byte CLOCK_MIN; // passed to RTC
int clock_min;
int alarm_min;


// Locking in time

int set_time = 0;

void set(){
 static unsigned long last_interrupt_time = 0;
 unsigned long interrupt_time = millis();
 // If interrupts come faster than 200ms, assume it's a bounce and ignore
 if (interrupt_time - last_interrupt_time > 500) 
  set_time  = 1;
  
}


// ULTRASONIC SENSOR
int trigPin = 10;
int echoPin = 8;
int duration;
int alarm_switch = 2;
long cm;
long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}


// Alarm function
int alarmpin = 13;

void alarm(){
  digitalWrite(alarmpin,HIGH);
  delay(1000);
  digitalWrite(alarmpin,LOW);
  delay(500);
  digitalWrite(alarmpin,HIGH);
  delay(1000);
  digitalWrite(alarmpin,LOW);
}

void alarmoff(){
digitalWrite(alarmpin,LOW);  
}

int hour_check;
int minute_check;

void checktime (){
byte hour; 
byte minute;
byte second;

readDS3231time(&second, &minute, &hour);
  hour_check = (int)hour;
  minute_check = (int)minute;

}


unsigned long alarmtime_past = 0;
unsigned long alarmtime_current = millis();

Wouldn't let me post straight away

Part 2/2:

void setup() 
{ 
  Serial.begin(9600);
  lcd.begin(16, 2);
  Wire.begin();
  Serial.begin(9600);
  pinMode(9, OUTPUT); 
  analogWrite(9, 150);
  pinMode(alarmpin,OUTPUT);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

// Attaching interrupting

attachInterrupt(0,modechange, CHANGE); //pin 2
attachInterrupt(1,set, CHANGE);//

// Calibrate during the first ten seconds 
   
   while (millis() < 15000) {
    hourvalue = analogRead(hourpin);
    minutevalue = analogRead(minutepin);
    
   // record the maximum sensor value for hours
    if (hourvalue > hourmax) {
      hourmax = hourvalue;
    }
    // record the minimum sensor value for hours
    if (hourvalue < hourmin) {
      hourmin = hourvalue;
    }
   // record the maximum sensor value for minutes
   if (minutevalue > minutemax){
    minutemax = minutevalue;
   }
   // record the minimum sensor value for minutes
   if (minutevalue < minutemin) {
    minutemin = minutevalue;
   }
  }
  
  setDS3231time(00,30,17);
}



void loop() {

 digitalWrite(trigPin, LOW);
 delayMicroseconds(2);
 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10);
 digitalWrite(trigPin, LOW);

 
 pinMode(echoPin, INPUT);
 duration = pulseIn(echoPin, HIGH);
 cm = microsecondsToCentimeters(duration);
 
 Serial.print("-------------------");
 Serial.print('\n');
 Serial.print(cm);
 Serial.print("cm and alarm_switch is ");
 Serial.print(alarm_switch);
 Serial.print('\n');
 Serial.print('\n');
 delay(2000);
 Serial.print("hour_check and minute_check is ");
 Serial.print(hour_check);
 Serial.print(" ");
 Serial.print(minute_check);
 Serial.print('\n');
 Serial.print('\n');
 delay(2000);
 Serial.print("alarm_hour and alarm_minute is ");
 Serial.print(alarm_hour);
 Serial.print(" ");
 Serial.print(alarm_min);
 Serial.print("\n");
 Serial.print('\n');
 delay(2000);
 Serial.print("alarmtime_past and alarmtime_current is ");
 Serial.print(alarmtime_past);
 Serial.print(" ");
 Serial.print(alarmtime_current);
 Serial.print("\n");
 Serial.print('\n');
 delay(2000);

// read the sensor:
  hourvalue = analogRead(hourpin);
  minutevalue = analogRead(minutepin);
  
// apply the calibration to the sensor reading
  hourvalue = map(hourvalue, hourmin, hourmax, 0, 24);
  minutevalue = map(minutevalue,minutemin,minutemax,0,60);
  
// in case the sensor value is outside the range seen during calibration
  hourvalue = constrain(hourvalue, 0, 24);
  minutevalue = constrain(minutevalue, 0, 59);


// SET TIME
if (mode == 1){

if (lcdmode == 2 || lcdmode == 3 || lcdmode == 4){
  lcdmode = 1;
  lcd.clear();
}

  if(hourvalue < 9){
    lcd.setCursor(1, 0);
   } 
     else {
    lcd.setCursor(0,0); 
    }
    
lcd.print(hourvalue);
lcd.setCursor(2,0); 
lcd.print(":"); 
lcd.setCursor(3,0); 

   if (minutevalue < 10){
      lcd.print("0");
      lcd.setCursor(4,0);
      lcd.print(minutevalue);
   }
    else{
      lcd.print(minutevalue); 
    }

lcd.setCursor(6,0);
lcd.print("SET TIME");

if (set_time == 1){
clock_hour = hourvalue;
clock_min = minutevalue;    
CLOCK_HOUR = (byte)hourvalue;
CLOCK_MIN = (byte)minutevalue;
setDS3231time(00,CLOCK_MIN,CLOCK_HOUR);
delay(2000);
set_time =0;
}

 }

// SET ALARM

if (mode == 2){

if (lcdmode == 1 || lcdmode == 3 || lcdmode == 4){
  lcdmode = 2;
  lcd.clear();
}

  if(hourvalue < 9){
    lcd.setCursor(1, 0);
   } 
     else {
    lcd.setCursor(0,0); 
    }
    
lcd.print(hourvalue);
lcd.setCursor(2,0); 
lcd.print(":"); 
lcd.setCursor(3,0); 

   if (minutevalue < 10){
      lcd.print("0");
      lcd.setCursor(4,0);
      lcd.print(minutevalue);
   }
    else{
      lcd.print(minutevalue); 
    }

lcd.setCursor(6,0);
lcd.print("SET ALARM");

if (set_time == 1){
alarm_hour = hourvalue;
alarm_min = minutevalue;
delay(2000);
set_time = 0;
}

}

// DISPLAY TIME

if (mode == 3){

set_time = 0;

if (lcdmode == 1 || lcdmode == 2 || lcdmode == 4){
  lcdmode = 3;
  lcd.clear();
}

displayLCDTime();

lcd.setCursor(6,0);
lcd.print("24H CLOCK");
}


// DISPLAY ALARM

if (mode == 4){

set_time = 0;

if (lcdmode == 1 || lcdmode == 2 || lcdmode == 3){
  lcdmode = 4;
  lcd.clear();
}

  if(alarm_hour < 9){
    lcd.setCursor(1, 0);
   } 
     else {
    lcd.setCursor(0,0); 
    }
    
lcd.print(alarm_hour);
lcd.setCursor(2,0); 
lcd.print(":"); 
lcd.setCursor(3,0); 

   if (alarm_min < 10){
      lcd.print("0");
      lcd.setCursor(4,0);
      lcd.print(alarm_min);
   }
    else{
      lcd.print(alarm_min); 
    }

lcd.setCursor(6,0);
lcd.print("ALARM TIME");

  
}
 
checktime ();

if (hour_check == alarm_hour && minute_check == alarm_min && (alarm_switch == 2 || alarm_switch == 1)){
alarm();
alarm_switch = 1;
}


if (alarm_switch == 1 && cm < 20){
alarmoff();
alarm_switch = 0;
alarmtime_past = alarmtime_current;
}

if(alarm_switch == 1 && alarmtime_current - alarmtime_past >= 60000){
alarm_switch = 2;
  
}


}

ahh I see that now, thank you.