Calc the remaining date: from now to the date of an API return

​​​​Hello everyone
I’m new on grafana and I get stuck in a problem. I’m using zabbix and grafana in the last versions.
I have one API that returns me a date, this return means that I have data until this date. The problem is that this date changes eventually, and I have to calc this for when it remains less than 2 days of data (2 days from the date), it will alarm critical(red), 3 to 2 days it will be warning(yellow) and more than 3 days will be OK(green).
I tried it many ways on zabbix and grafana too, but unsuccessfully. Actually, I have on my zabbix the return of this API, it is in epoch time, but I converted and zabbix is giving me the correct date. I’ve made one of the current date too.
There is a way to do calc this on grafana?