funcst to properly detect timeframes for warnings