How to synchronize a variable on the client and the host?

I am trying to make a countdown that would be the same on the client and the host. The problem is that when the host starts the game and the timer starts, if the client enters the game his timer will start at 60 secounds but the hosts won’t change. it seems like both of them have their own variables, but i checked and they don’t. I tryied using SincVar, but it doesn’t work.
My script:

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 using UnityEngine.SceneManagement;
 using UnityEngine.Networking;
 
 public class timer : NetworkBehaviour
 {
     int tr;
 
     [SyncVar(hook = "OnTimeChange")]
     int timeRemaining;
 
     public string scene;
 
     void Start()
     {
         if (isServer)
             timeRemaining = 60;
         tr = timeRemaining;
         InvokeRepeating("decreaseTimeRemaining", 1.0f, 1.0f);
     }
 
     void decreaseTimeRemaining()
     {
         //Debug.Log(timeRemaining);
 
         if (isServer)
         {
             Debug.Log("I am the server.");
             //CmdSetTime(timeRemaining-1);
             timeRemaining--;
         }
     }
 
     public int getTimeRemaining()
     {
         Debug.Log("Get it" + tr);
         return timeRemaining;
     }
 
    // [Command]
     void CmdSetTime(int t)
     {
         Debug.Log("cmd set time:" + t);
         t = timeRemaining;
         t = tr;
     }
 
     void OnTimeChange(int t)
     {
         Debug.Log("On time change:" + t);
         if (!isServer)
         {
             Debug.Log("Dumb times" + t);
             timeRemaining = t;
             tr = t;
         }
     }
 
 }

Could anyone help?
Than you in advance.

Basically. If you only need the client to know when the timer is over just have the countdown happening on the server and then, once it is done send a TargetRpc(call from server to one specific client) to your client. If you wanna display a countdown on your client (like 1,2,3,4 using UI or something) you better off creating a countdown timer on the client which will only affect the graphics while the server timer (a different one) will handle doing stuff when it is over to prevent hacking! Why not have a timer synced between server and client??? Because it is a huge waste of bandwith constantly syncing stuff that can be done locally.

Create a timer on the server (secure) to handle important events and stuff

Create a timer on the client (not sync it from server, it is a waste of bandwith) to handle graphics only! Basically 1,2,3,4,5,6,7 bla bla bla.

Keep them in sync. When you need to reset them reset them both on server and client. It is much more efficient than syncvar (sending 32 bits(int) 10 times a second…).

I am sorry i am new to posting questions on here so i am not really sure if i am doing everything correctly.
The secound try:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityEngine.Networking;

public class timer : NetworkBehaviour
{
    int tr;

    [SyncVar(hook = "OnTimeChange")]
    int timeRemaining;

    public string scene;

    void Start()
    {
        if (isServer)
            timeRemaining = 60;
        tr = timeRemaining;
        InvokeRepeating("decreaseTimeRemaining", 1.0f, 1.0f);
    }

    void decreaseTimeRemaining()
    {
        //Debug.Log(timeRemaining);

        if (isServer)
        {
            Debug.Log("I am the server.");
            //CmdSetTime(timeRemaining-1);
            timeRemaining--;
        }
    }

    public int getTimeRemaining()
    {
        Debug.Log("Get it" + tr);
        return timeRemaining;
    }

   // [Command]
    void CmdSetTime(int t)
    {
        Debug.Log("cmd set time:" + t);
        t = timeRemaining;
        t = tr;
    }

    void OnTimeChange(int t)
    {
        Debug.Log("On time change:" + t);
        if (!isServer)
        {
            Debug.Log("Dumb times" + t);
            timeRemaining = t;
            tr = t;
        }
    }

}