Computer time

From Teknologisk videncenter
Jump to: navigation, search

Challenges

If you were tasked to write a program that would calculate date and time 100 minutes into the future based on local date and time clock. Sounds simple enough, but take these examples into consideration:

  1. Program starts 7 minutes before new year
  2. or 3 minutes before changing to summer time adding one hour to local time. Would your program show the time after 40 or 100 minutes?
  3. or 70 minutes before changing back from summertime to normal time removing one hour.
  4. or how about 23:58 February 28th before a leap year or if a leap second was introduced.