CPB Mailing List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
TDateTime
Thinking on about this TDateTime century conversion problem, I suggest the
following solution. For each type of date input in your application, create
a subclass of TDateTime that converts the date in appropriate fashion, for
instance TBirthDateTime for a personnel file could presume that date swill
always fall into the last 100 years (1899-1998), or even earlier (year-10 to
year-109); TDeliveryDateTime could use a 50-year each way window
(1949-2048), and TInvestmentDueDateTime could use a future-only conversion
(1998-2097). That way, each TDateTime variable keeps its own rules, and
applies them automatically. A generic TVarDateTime that has a Window
variable would also be useful for special cases.
I don't have the time, inclination or requirement just now, but if I don't
think of a better solution, this is what I'll probably do.
Philip Hibbs
Senior Analyst
PC Development
TNT UK Information Technology
Atherstone
W Komornicki's Home Page |
Main Index |
Thread Index