|
Sesame Library | Date and Time in a Client-Server Environment
When you and your data are in the same place,
determining current date and current time are easy. Whether you are running
stand-alone, or across a network, as long as the client machine and the
server machine live in the same time zone, all is well.
However, if you are a widget company with travelling salespeople who need
to enter orders while on the road, it gets a bit trickier. Say you design an
Orders database. The intent is for your salespeople to be able to access
that Orders database through networking or the Internet and enter orders.
You want each record to show the date and time the salesperson entered it.
You put the Orders database on your server, which is located in
California. You send your salespeople out to Texas, New York and Oregon.
They sell lots of widgets. Returning to their respective hotel rooms later
that evening, they all boot up their laptops, log in around the same time,
bring up the Orders database, and start entering the orders. They get to the
DateEntered field and press Ctrl-F5 to insert the current
date. They get to the TimeEntered field and press Alt-F5 to
insert the current time.
Here's where it gets tricky. There are two places Sesame can look for the
information. Sesame can ask each Client (salesperson's laptop) or Sesame can
ask the Server. If Sesame asks each Client, even though all the orders are
being entered at the same time, they will be stamped several hours apart. If
the salespeople have been sent to other countries, even the dates may be
different. However, if Sesame asks the Server, then all the records will
have consistent information, but the salespeople may be confused by what
looks like incorrect dates and times.
After much consideration, we went for data consistency. When asked for
the current date or time, Sesame will use the Server to determine the
information. This will have no visible effect on those of you who are
running stand-alone. It will have no visible effect for those of you who run
a local network, unless, for some reason, you set your Server to a different
locale than the rest of the computers in your office. For those of you who
set up Sesame to be accessed over the Internet or a wide area network, when
asked to provide the current date or current time, Sesame will ask the
Server. This will keep the data itself date- and time-consistent.
For dates and times used by programming, like @DATE and @TIME, we intend
to provide functions that the programmer can use to specify which they want
-- @CLIENTTIME and @SERVERTIME, etc. @DATE and @TIME will still work, but we
provide you with some more specific choices, if you want to use them.
|