For relative time formats, /phpbb/datetime class will render (best to reproduce with 'UTC' timezone):
YYYY-MM-DD 00:00 - for $midnight - 86400 (should be Yesterday 00:00)
Yesterday 00:00 - for $midnight (should be Today 00:00)
Today 00:00 - for $midnight + 86400 (should be Tomorrow 00:00).
Additionally, it will render 'less than a minute ago' for timestamps from the future:
timestamps up to 5 seconds ahead, or
timestamps up to 59 seconds ahead if the same minute with the current time.
This seems to be intentional but currently the intention is not clear.