I have a programm written in Java, that caches data from the twitch api. it updates the values periodicly (e.g. 5 minutes). I let it run on a Server.
That is how i handle things like your question by my own.
If you have some more things like this question, things the api can not serve u directly, it could be useful caching data by your own (but dont spam the API).
In php it would be like:
<?php
$_channel = "rocketbeanstv";
$data_array = json_decode(file_get_contents("https://api.twitch.tv/kraken/streams/$_channel/"), true);
if ($data_array["stream"] != null){
//call function
UpdateSQL();
} else { //donothing }
and the Function “UpdateSQL” updates the column(DATETIME) in the row where channel = $_channel.