Yep I'm with Marc, ideally use a database which can issue the next
unique ID (make sure your locking is sorted, you don't want two
concurrent requests returning the same ID), or a web service or
similar. If you're not going to be generating new ID's that frequently
you can encode the time it's generated to the nearest millisecond into
a string. A literal string representation would be too long, so you
would need to encode it.
YYMMDDHHMMSSmmm is 15 chars long, but if you think about it, YY is
going to be 07-99 assuming your software runs for 92 years but lets say
07-30, MM is 1-12 for month, 0-59 for minutes. DD 1-31 SS = 0-59 mmm =
0 to 999.
So you can represent YY with one char by using A for 07 and Z for 33
for example
0-59 is easy if you just add 32 you'll get a nice printable character,
so now we're down to
YMDHMSmmm with one left over.
I'd still recommend the server route though.