somebody said:
We have a C++ programming intern at work. Last week he introduced
himself, and told me that if I have any "crappy" programming jobs
needed done, he could handle them. Can anyone recommend some
programming task that would be ridiculously difficult?
I just want to play a joke on him as a way of saying, "welcome to
the asylum! <g>
Here's a practical one:
Write an API (class or standalone functions) for converting any
time_t value from one local time to the local time of any other region.
It can be any datetime a time_t can hold, ie. not necessarily the
current time. For example you have a local time_t value orginated
in New York (ie. the natural time; incl. DaylightSavingTime adjustment).
The task is to convert such a time_t belonging to a region to time_t
of another region, say Berlin, including Daylight Saving Time adjustment
for the destination region.
The solution must use standard C/C++ library functions only and by
this must be portable say between Windows and Linux/Unix, and
the timezone setting of the machine must not be changed.
The DST rule for any region should be definable on the fly
(ie. via a function call), and once defined for a region it should be
treated as being constant for all times (in reality it is of course not
since the politicians of the regions decide whether, when and which
rule they want to use).
Obviously the implementation should be fast.
Sounds maybe simple to do, but it could be a challenging task.