It looks like you need timeofday (), see the Postgresql docs down the bottom. Most of the date and time functions do not advance during a transaction.