A
Alan M Dunsmuir
I need to specify a new data type, almost entirely a 'clone' of the
existing DateTime type, with the following specific difference, and all
the consequent differences in properties and methods which this one
change implies.
The day immediately before Thursday September 14, 1752 should be
reported as Wednesday September 2, 1752, and so on, for all earlier
dates. Note that this change not only disrupts the steady sequence of
'one day at a time', but also breaks the mapping of Date on to
DayoftheWeek for all earlier dates, and Date on to DayoftheMonth and
DayoftheYear for earlier dates in 1752.
This is what actually occurred historically in the UK (and, I believe,
in North America) when the Gregorian calendar was finally adopted here.
I note that, since DateTime is a Value Type rather than a Reference
Type, I can neither inherit from it nor build a Class based on it. So it
would seem that a Structure has got to be the way to go. But I am not at
all sure of the detailed steps in building this, and getting it to work
as required.
Should this structure contain one or more (hidden) DateTime elements, to
facilitate use and adaptation of the existing properties and methods of
the underlying data type?
Would my structure be able to use the existing DateTime formatting
options once it has been built?
existing DateTime type, with the following specific difference, and all
the consequent differences in properties and methods which this one
change implies.
The day immediately before Thursday September 14, 1752 should be
reported as Wednesday September 2, 1752, and so on, for all earlier
dates. Note that this change not only disrupts the steady sequence of
'one day at a time', but also breaks the mapping of Date on to
DayoftheWeek for all earlier dates, and Date on to DayoftheMonth and
DayoftheYear for earlier dates in 1752.
This is what actually occurred historically in the UK (and, I believe,
in North America) when the Gregorian calendar was finally adopted here.
I note that, since DateTime is a Value Type rather than a Reference
Type, I can neither inherit from it nor build a Class based on it. So it
would seem that a Structure has got to be the way to go. But I am not at
all sure of the detailed steps in building this, and getting it to work
as required.
Should this structure contain one or more (hidden) DateTime elements, to
facilitate use and adaptation of the existing properties and methods of
the underlying data type?
Would my structure be able to use the existing DateTime formatting
options once it has been built?