Friday, June 17, 2016

Support Timezone

What is a timezone?

A timezone is a region that shares the same interpretation of time based on their relative position on Earth to Sun.

Why do we have timezones?

A moment for people on Earth are the same, but people describe the moment differently.  For some people, such as me, who is living in San Francisco Bay Area, the time is 3PM now, but for people living in India, it is 3:30AM in the morning.  Also, timezone change the way how to view their date within the calendar.  For me, it is June 10, 2016, but for people living in Bangalore, India, it is June 11, 2016 already although many of them have not yet waked up.

When people look at the evnts happened in the past or the events should happen in the future, they may want to describes the time.  Time components of a timestamp data helps describing the time when the event happened or should happen.  It is the reason why we need to support timezone.  It helps accurately describing the time.  If you just need to roughly describe the time at the "date" or "month" level, you do not need to mention time zone.


What if we do not capture time zone?

If we do not capture time zone as part of our database, it does not necessarily mean that we cannot work with people who are working under different timezone.

We may just work on an agreed time zone and describe the time using a single and implicit time zone. 

If we only work with people locally, a timezone is almost implicitly assumed.  When I leave the home and told my wife that I will come back at 6pm this evening, I do not need to mention timezone.  She and I live in the same time zone. She know what I mean.

Timezone is really useful when the people view data are in different time zones.  So we can say that timezone is a globalization feature.

How should we store and display the data?

It would be convenient if the system can display the time in user's time zone.  However, if the user does not trust the system, it may actually be confusing.  A user may want to know what's the time zone the time I see means.  In this case, the system should have a way to display time zone along with the time as an optional feature.  Date/Time formatting is another interesting topic, and displaying time zone along with time components should be considered.

For storing data, time itself is not meaningful unless we know the timezone is.  It is important to know which timezone the time is described based on.


Post a Comment