This script is designed for ksh, and relies on the fact that Unix increments a variable called SECONDS every second.
If you don't change the value of SECONDS, it contains the number of seconds since you logged in.
Here is the script, which we can call "timeprompt". It inserts the time into your existing ksh prompt.
Place timeprompt somewhere in your PATH.
Modify your .profile and insert a line after your PATH and PS1 have been set. Use this command: ". timeprompt"
This version of timeprompt begins by setting SECONDS equal to the time (the number of seconds since midnight).
It then creates three variables that will always contain two-digits and be zero-padded.
The _time variable is set to a formula that uses the evaluation of subscripts in a dummy array _x to format the time.
The last line of timeprompt inserts _time , and a newline character into your prompt.
Replace \n with a space if you want a single line prompt, but this may become too long if you also include values such as ${HOSTNAME}, ${LOGNAME} and ${PWD}
Timeprompt has been tested on AIX and UnixWare. It may require some modification to work with ksh on other versions of Unix.