Can anyone please give me the formula to obtain the minutes since the last weather update?

Hello all.
Please forgive if this is too basic a question, but I'm trying to re-create my widgets from zooper to migrate to kustom, and I'm not making much progress because I'm really not very good at coding or logic reasoning in general.
If this is not the right place to ask, please let me know if there is a noob-friendly place to ask questions such as these.
In the meantime, could someone please give me the formula to obtain the time since the last weather update, converted to minutes?
Much thanks