added lifetime calculation for VERSION file

This commit is contained in:
Барсуков Александр 2022-05-18 22:49:51 +03:00
parent 70cc1e5401
commit 5ffb3af991
1 changed files with 9 additions and 0 deletions

View File

@ -86,3 +86,12 @@ function get_inc_game_version()
return $string;
}
function get_version_file_lifetime()
{
global $GAME_ROOT;
exec("git log --follow --format=%ad --date=format:'%Y-%m-%d %H:%M:%S' " . $GAME_ROOT . "/VERSION" , $creating_timestamp);
$minutes = (time() - strtotime($creating_timestamp[0])) / 60;
return ceil($minutes);
}