Although stored in the XML as an ISO date/time string, within the app Date-type date is treated as a millisecond offset from the unix epoch. IOW, date-time ‘arithmetic’ is maths done on numbers of milliseconds which are then parsed back to the UI in human-understandable date-times.
Also, a side-effect of the above is regardless of how rendered, there is no notion a a time-less date, IOW a date scoped to day at minimum. Time might seem immaterial, but even if working in years, we might want to know Jean D’Arc age at death based on knowing the year (portion) of the date(-time)s of her birth and death. Dates stored as strings needs to be turned into a number for that sort of maths, so dates-as-strings help … until they don’t. Again, there is no one-size-fits-all answer.
Plus if we do translate from string storage to number for a day-scoped date, where to we set the time that arises (noting date-time maths is in milliseconds). My best guess is midday (12:00:00) which lessens the chance of off-by-one destructive effects of timezone modification of date times.
Time … is more complex than we allow for. As stated above, for ‘historical’ dates we don’t generally want to have time adjustments. But computers weren’t designed by historians (or non–engineers) and so there is no clean delimitation of fixed (zone-agnostic) vs fluid (zone-observant dates).
A kludge for now is to set the day of the date as a string or number at creation, and had an edict or stamp (rule is overkill) to check if the stored day number is the Date.day number of the date-type attribute. If note, reset the Date-type day.
As Date.day returns a number, we’ll store a new $StartDate’s day and $StartNumber. Now the code can check:
if($StartDate.day != $StartNumber){ $DateDate.day = $StartNumber;}
Of course for each Date-type attribute *$StartDate, $EndDate, etc.) in use you’d need a corresponding Number-type user attribute . Let’s assume for the moment were are only using $StartDate and $EndDate and have made $StartNumber and $EndNumber. Then you could make a stamp for new notes to use once start/end dates are set:
$StartNumber = $StartDate.day;
$EndNumber = $EndDate.day;
But, as for pre-existing date munged by time offsets, I suspect that is a case of review that is pretty manual.