Jay B. Harlow said:
John,
KA BOOM!!!! Your sample just gave me hundreds of duplicate entries!
At the very least you may want to include ALL 7 digits for milliseconds!
Plus full width (both digits) for months, days, hours, minutes & seconds!
As your string will give duplicates on for Jan 11th & Nov 1st, plus it
will give duplicates between for 11:01 & 1:11!
To see what I mean try the following:
Dim dt1 As DateTime = #1/11/2005 11:01:00 AM#
Dim dt2 As DateTime = #11/1/2005 1:11:00 AM#
Dim str1 As String = dt1.ToString("MdyyHmsfff")
Dim str2 As String = dt2.ToString("MdyyHmsfff")
Debug.WriteLine(str1, dt1.ToString())
Debug.WriteLine(str2, dt2.ToString())
Debug.WriteLine(str1 = str2)
Of course when the clock falls back for daylight savings time, there will
be an hour where duplicates are also created! Also if you explicitly
adjust your clock or Windows adjusts your clock, you will have another
opportunity for duplicates.
My money is on using the full "precision" of System.Guid.
Hope this helps
Jay