If you mean a wall clock time, it’s
function update () { clock.setText(new Date().toLocaleTimeString()); }