history

I need the script that will write to a file all commands which were executed
and the time for all of this commands.
Or maybe it can be done with history, or script utility (bash)?

What you want to do can easily be done in the bash shell. For timestamps, just set HISTTIMEFORMAT. Check out HISTFILE, HISTSIZE, HISTFILESIZE, HISTCONTROL, HISTIGNORE also.