The upcoming JAXDUG meeting is centered around code/thought exercises to solve business problems. That meeting posting makes mention of the Supermarket Pricing exercise from the Code Kata site, as well as asking others to submit ideas for exercises. I presented one for consideration, and I just received one from JAXDUG member and MS Speech Server MVP, Marshal Harrison. Marshall's kata is as follows:
I would like to see a kata devoted to collecting time from users.
Too often the quick solution seems to be record everything using Universal Time or in the local time zone (i.e. EST for JAXDIG members).
However this solution overlooks the complexities involved when collecting time from remote users either via some web interface or via phone. For example let’s say you have an alert scheduling service and a remote user schedules something for 8:00 AM his local time in San Francisco. If you are hosted in Jacksonville you don’t want to alert him at 8:00 AM system time of the application as that will be 5:00 AM local time for the user. Not what the user intended.
While it is acceptable to store things using UTC how does one respond to events in the local time of the user?
Some issues to consider:
- What is the local time of the user – i.e. how do you determine the user’s time zone?
- What about Daylight Saving Time – not every state uses DST.
- What do you do when time zones don’t follow state lines. Florida has two time zones as do numerous other states.
- How do you handle the transition from normal time to DST or vice versa? For example when does 2:30 AM occur? Actually it occurs twice when you do the transition in the fall but doesn’t occur at all during the spring transition.
These are just some of the problems encountered when dealing with a distributed user base for applications that deal with times of events.
Anonymous comments are disabled
About Jonathan Bates
Jonathan Bates is the latest President of the Jacksonville Developers User Group.
He has had a long and storied path on the way to I.T. work. At one point, Jonathan had a near Neo-Luddite position about computers, believing them at worst to be the means to humanity's eventual slavery and at best tools for general evil. After landing a job powered by such advanced technologies as Windows 3.11 for Workgroups and MS Access, Jonathan began to change his opinion on computers. He began to believe that they might be for more than just improving the display and sound qualities on his Laserdisc movies. In time, he came to see that computers were nothing more than tools, not much different then a hammer (though not as good to drive nails with).
Jonathan Bates is an industry-certified and proven developer and trainer, facilitating the transfer of knowledge from conceptual client request to delivered and implemented solution. Jonathan enjoys sharing his knowledge and understanding about development principals with like-minded people. You can generally find him enjoying good company discussing his personal Unified Theory and how programming can be used to describe it. And if you can't find him, drop him a line with a time and place and he'll find you.
Contact him at jonathan.bates@batener.org.