Berean Study Bible (BSB) - Ecclesiastes 8:5 >

Whoever keeps his command will come to no harm, and a wise heart knows the right time and procedure.

Jewish Publication Society of America Version (JPS1917) - Ecclesiastes 8:5 >

Whoso keepeth the commandment shall know no evil thing; and a wise man's heart discerneth time and judgment.