473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Best way to store multiple work times across timezones

Here is a debate we have been having at work about the design of our
timeclock database application. We have built an online timeclock
system for companies to use to keep track of their employees hours. In
brief, an employee can clock in and clock out by loggin through the
site. All of their work dates are recorded and the employeer can poll
reports based on employees in/out times, calculate hours, mark the
hours as paid etc.

The issue is that we are now implementing a timezone feature for each
employee. Currently, all times are recorded in PST off the server
clock which is calibrated to the US atomic clock. Now we have
implemented the ability for the user to choose their timezone, as the
system is intended to track multiple employees all over the world, and
view their in/out times and reports in the time zone they are in.

The debate is whether to record everyone's time in PST and calculate
their timezone offset when the data is queried, or to convert the time
to the selected timezone and write it to the database that way. Then
the data could be queried and just output without any manipulation.

I advocate storeing all the times in PST and letting the database do
the conversion when the data is queried. That way it is all uniform
consistant atomic values which allow for the most flexibility since
all the times can be converted to any other zone via some batch
process.

The argument for converting before is that no one will care about
seeing all times across multiple zones in a uniform format and that it
is more important (and less processing) to output the relative times
to the zone they were recorded in.

Any thoughts on this topic would be greatly appreciated as this has
recently become a hot topic. Which is the most practical, scalable,
and efficient way to do it? Any other designs are also greatly
welcome...

Thanks
Jul 20 '05 #1
1 2062
Anthony wrote:
Here is a debate we have been having at work about the design of our
timeclock database application. We have built an online timeclock
system for companies to use to keep track of their employees hours. In
brief, an employee can clock in and clock out by loggin through the
site. All of their work dates are recorded and the employeer can poll
reports based on employees in/out times, calculate hours, mark the
hours as paid etc.

The issue is that we are now implementing a timezone feature for each
employee. Currently, all times are recorded in PST off the server
clock which is calibrated to the US atomic clock. Now we have
implemented the ability for the user to choose their timezone, as the
system is intended to track multiple employees all over the world, and
view their in/out times and reports in the time zone they are in.
I would not implement this "timezone feature" at all unless you are
prepared for all the additional issues that will come along with it. An
employee's timezone is not a constant. It changes every time (s)he is
transferred or even takes a trip from the home office in San Diego to do
a couple of weeks of field work in (let's say) New Delhi. If the point
is to be able to display local standard time for each timestamp, then
you may be buying into tracking the entire history of the employees
movements. Are you sure you want to do that?
The debate is whether to record everyone's time in PST and calculate
their timezone offset when the data is queried, or to convert the time
to the selected timezone and write it to the database that way. Then
the data could be queried and just output without any manipulation.
I don't see what's to debate. I would do the whole thing in GMT at the
database level - and personally I would try like hell to get away with
using GMT at the presentation level as well. Conversion to local
standard time is no big trick - but it's still not guaranteed to be the
same as local clock time (because of DST) and so will inevitably confuse
people anyhow.
I advocate storeing all the times in PST and letting the database do
the conversion when the data is queried. That way it is all uniform
consistant atomic values which allow for the most flexibility since
all the times can be converted to any other zone via some batch
process.


I would recommend GMT over PST, it's just way more standard. Also, if
you do end up supporting time zone offsets, they are normally specified
as offsets from GMT. Someone in Adelaide could very likely tell you
that his offset is +09:30 from GMT - his Windows PC can tell him that
much - but what are the chances that he knows his offset from PST?

JMHO,
-rick-
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Bob Bedford | last post by:
Sorry if I post here, but I don't have access to any valuable mysql ng for this question, ans since 99% or php programmers deal with mysql, I'm sure I'll get an answer here. Look at the...
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
12
by: Perre Van Wilrijk | last post by:
Hi there, When I started using VB6, I used to write classes with properties and functions as following ... Private lngf1 As Long Private strf2 As String Public Property Get f1() As Long...
22
by: Brett Romero | last post by:
If my UI app uses three DLLs and two of those DLLs reference something named utilities.dll, does the UI app load utilities.dll twice or does the compiler recognize what is going on and load...
3
by: mkjets | last post by:
I have worked for hours on trying to find a solution and have not figured it out. I am working in Access 2003. I need to create a query that takes values from 1 table and displays them in...
32
by: David Isaac | last post by:
I have no experience with database applications. This database will likely hold only a few hundred items, including both textfiles and binary files. I would like a pure Python solution to the...
2
by: Ashley | last post by:
hey, what's up............................. "Neil" <nospam@nospam.netwrote in message news:8YFwj.10509$0o7.1113@newssvr13.news.prodigy.net...
13
by: DigitalDave | last post by:
A project I did awhile back stored php5 objects in elements of the $_SESSION array between pages that were navigated on the site. There were object classes representing teachers, and object classes...
1
by: Andy | last post by:
I want to store a key in an ASP.NET session variable that points to an ASP.NET page cache. The page cache contains an XML document that holds a draft of the user's work. After the user is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.