如何使用 React JS 将 5 分钟的倒计时间隔计时器偏移 1 分钟

How can I offset a 5 minute countdown interval timer by 1 minute, using react JS

我想在 React JS 中制作一个 5 分钟的间隔计时器,它会偏移 1 分钟。
我下面的计时器位于 1:00 => 1:05 => 1:10 => 1:15 => 1:20。
我需要将其偏移到 1:01 => 1:06 => 1:11 => 1:16 => 1:21。
计时器需要与洛杉矶时区同步。
如果可能,寻找最干净的 es7 代码。
我正在使用 NextJS 框架。
这是我到目前为止的代码。

  const [timer, setTimer] = useState("")

  const secondPassed = useCallback( () => {
    const cur_date = new Date();
    const minutes = cur_date.getMinutes();
    const seconds = cur_date.getSeconds();
    console.log( (4 - minutes % 5) + ":" + (seconds >= 50 ? "0" : "") + (59 - seconds))
    setTimer( `${(4 - minutes % 5) + ":" + (seconds >= 50 ? "0" : "") + (59 - seconds)}` )
  },[])
  
  useEffect(()=>{
    setInterval(secondPassed, 1000)
  },[])
const [time, settime] = useState()

const cur_date = new Date();
const minutes = cur_date.getMinutes();
const seconds = cur_date.getSeconds();

if(minutes === "your timing start") {
settime(minutes) }

if(minutes ==== time + 5 ) {
settime(minutes)
}

我将开始日期偏移 1 分钟。

const [timer, setTimer] = useState("")

  const secondPassed = useCallback( () => {
    const cur_date = new Date( Date.now() - 1000 * 60 );
    const minutes = cur_date.getMinutes();
    const seconds = cur_date.getSeconds();
    console.log( (4 - (minutes % 5)) + ":" + (seconds >= 50 ? "0" : "") + (59 - seconds))
    setTimer( `${(4 - (minutes % 5)) + ":" + (seconds >= 50 ? "0" : "") + (59 - seconds)}` )
  },[])
  
  useEffect(()=>{
    const run = setInterval(secondPassed, 5000)
    return () => clearInterval(run)
  },[])