It’s not the fault of as_timestamp. It’s just a matter of ensuring the computed value represents minutes.
The example I posted computes the time difference using datetime objects instead of timestamps but it’s just another way of doing the same thing. The added bit is dividing by 60 to convert seconds to minutes.