Technically that aren't a random numbers. You may easily generate them if you store both the
date
and
sequence number
of the last generated one in a persistent storage (e.g. file, database). Then
- if date changed, use the new date and reset the sequence number.
on the other hand
- if the date is the same then use such date and increment the sequence number.