My timer won't work?

So I am making a game where when the timer hits one min you fail and have to restart. I am working with my friend on this he’s pretty expeirenced and I am a beginner. This code is not working. using

System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Timer : MonoBehaviour
{
Text text;
float theTime;
public float speed = 1f;

Text MaxTime;
Text CurrentTime;

// Start is called before the first frame update
void Start()
{
    text = GetComponent<Text>();
    CurrentTime = GetComponent<Text>();
}

//Update is called once per frame
void Update()
{
   theTime += Time.deltaTime * speed;
   string hours = Mathf.Floor((theTime % 216000) / 3600).ToString("00");
   string minutes = Mathf.Floor((theTime % 3600) / 60).ToString("00");
   string seconds = (theTime % 60).ToString("00");
   text.text = hours + ":" + minutes + ":" + seconds;

    if (CurrentTime.text = "01:00:00".ToString)
    {

    }

}

}

I made a test game with a timer on the screen. The original code does work it was but the time was set to 1 hour.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Timer : MonoBehaviour
{
    [SerializeField] float speed = 1f;

    Text text;
    Text MaxTime;
    Text CurrentTime;

    float theTime;

    // Start is called before the first frame update
    void Start()
    {
        text = GetComponent<Text>();
        CurrentTime = GetComponent<Text>();
    }
    //Update is called once per frame
    void Update()
    {
        theTime += Time.deltaTime * speed;
        string hours = Mathf.Floor((theTime % 216000) / 3600).ToString("00");
        string minutes = Mathf.Floor((theTime % 3600) / 60).ToString("00");
        string seconds = (theTime % 60).ToString("00");
        text.text = hours + ":" + minutes + ":" + seconds;
        if (CurrentTime.text == "00:01:00".ToString())//This time was set to 1 hour. 
        {
            //Do something here when the time is up.
            Debug.Log("Time Is Up");
        }

    }


}

I answered this question once before here: How to code timers without creating new strings every frame

NOTE: this solution is probably for more advanced programmers (at least because of that lambda/anonymous function syntax). Nevertheless you can still look up some useful ideas from there.

I can’t help because I’m the friend you are talking about!

I am looking at your code and it hurts my eyes to see all that division. division is much harder on a CPU than multiplication and you are calling it all once per frame!
anyways here is a simpler way that works

public int min;
public int sec;
public int hour;
public string show="00:00:00";
public float f;

void Update () {
	f += Time.deltaTime;
	if (f > 1) {f-=1;
		//one second has passed so now we do stuff
		sec++;if(sec==60){sec=0;min++;if(min==60){min=0;hour++;}}
		show = format (hour)+":"+format(min)+":"+format(sec);

		//check for time and update your display here
		print (show);
        }}
public string format (int z){
	string r = "" + z;
	while(r.Length<2){r="0"+r;}
	return r;
}