Thank you for considering my suggestions! Just as a test, I entered these 3 pillars:
H D M Y
? Ding Yi Bing
? You Wei Wu
And I get the following results:
Similar dates:
1966-8-6, 1786-7-20, 1726-8-4, 1546-7-9, 1486-7-24, 1306-7-9, 1246-7-24, 1066-7-9, 1006-7-24, 826-7-9, 766-7-24, 586-7-9, 526-7-24, 346-7-9, 286-7-24, 106-7-9, Search Famous Charts
That's very nice! We see that prior to 1966, there is no date in 1906 and 1846 that matches the above 3-pillar set. Why did I think of these two missing years? Because 1906 = 1966 - 60, and 1846 = 1906 - 60. Your program is correct, because we should know that a four-pillar set does not always repeat itself every 60 years. And I have verified it with my Chinese calendar.
I see that the results are ordered Year-Month-Date, for example 1966-8-6 means 1966, August 6. This is my favorite order (which is how the Chinese say it in their language), but I am not sure that other users understand this order. Another suggestion is to put a legend, something like
Similar dates (Y-M-D).
By the way, I did this test while having the YMDH order unchecked.