[fpc-pascal] best? safest? fastest?
Mark Morgan Lloyd
markMLl.fpc-pascal at telemetry.co.uk
Wed Aug 6 10:08:35 CEST 2014
waldo kitty wrote:
> i suspect this is going to be like the long-standing joke of
>
> cheap, fast, stable: choose two
>
>
> over the years, i've seen two schools of code for dealing with dates...
> years, specifically... one school is string based and the other is math
> based... both have their faults and pluses...
>
> eg: string based fault : prepend '19' to single digit year value
> math based fault : 2003 - 1900 = 103 (3 is intended result)
I'd be inclined to start off using your method 1, i.e. text manipulation
until the format is consistent.
Flatten the original record and save it in a database, create a new flat
text record starting with a database reference and then comprising
slightly-massaged text. Run consistency checks on the new records until
everything looks good (e.g. no non-numeric garbage resulting from a
failed EBCDIC or GOST conversion), and only then parse it into numeric
fields.
Out of curiosity, I presume that times are GMT/UTC but does a day start
at midnight or noon (civil and astronomers' convention respectively)? Do
the coordinates have to take into account changed ephemeris changes as
the equinox precesses?
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the fpc-pascal
mailing list