I worked on a family archiving product (which dead ended) and dealt with this problem. My hacked solution was to repurpose the seconds value to encode precision, as you generally don’t care about seconds.
I forget the exact scheme, but it was something like this:
I forget the exact scheme, but it was something like this:
Also note that the ISO date standard allows you to drop any digits you aren’t sure about, so all these are valid: