Hi,
using the current system time to get a unique value is dangerous if the underlying server follows DST (daylight saving time).
What happens if you generate a key around the switch from DST back to normal time?
In this case you end up with one hour every year where you can have duplicates...
If you don't want to store all the previous data in a table, you could use a combination of current date and a generated random code. Store the random part in a table and truncate it every midnight.
Regards
Lutz