• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dealing with Time Differences

 
Javini Javono
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Here are some ideas for dealing with time differences betweent the
remote client and the server. Assuming I can justify having the home
user book (which I'm beginning to think is a requirement), then time
has to be dealt with.
This post has not been completely thought out yet; and, it's possible,
given the way the database is defined, that there is no solution.
Determining Date For Adding New Unbooked Hotel Room
------------------------------------------------
The remote client, a hotel representative, wants to add a new, unbooked
hotel room to the database, and specify when the room will be available.
The client sends the server the following information:
1. The current date and time
2. The date and time the room is available.
The server determines its current date and time.
The server can then determine the date and time the room is available
with respect to the server's time zone; and, this date is entered into
the database.
[Or even simpler, the client simply sends the time differential between
the client's current time and the time the room is available.]
Determining Whether A Client Is Within Time Range to Book a Room
---------------------------------------------------------
Problem: the client needs to know, with respect to the client's time
zone, if the room is bookable (falls within 2 days).
So, I think that you can do the exact opposite:
The server sends the client
1. Its current date and time.
2. The date and time the room is first available.
The client determines its current date and time.
The client can then compute, with respect to its own time zone,
when the room will be first available, and then the client can
determine if it is within the 2 day range.
[Or even simpler, the server simply sends the time differential between
the server's current time and the time the room is available as stored
in the database.]
Of course, the server may not want to send back every active record
to the user, but may first filter it to send back only potentially
bookable records, but this is discussed in another thread.
Notice that this is an interesting solution in that Locale-type
classes are not needed.
Thanks,
Javini Javono
[ January 19, 2004: Message edited by: Javini Javono ]
[ January 20, 2004: Message edited by: Javini Javono ]
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a requirement in your assignment that explicitely states anything about the relevance of time? I think everyone gets a slightly different version, so what is there in your requirements that makes you think that you should account for time zones, or for time in the first place?
 
Javini Javono
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My instructions.html file is ambiguous like everyone elses.
But, there exists a line in he specification which goes something
like this: "the CSR and the user ...". And, from this, I take it the
"user" in this context is the people who will be booking from their
homes and who are not employed by the company.
Also, there is no guarantee that the company employees will all
be located in the same time zone.
Assuming the above idea or algorithm is logically correct, it
doesn't seem to demanding to add it to the specifications.
Your question, is valid of course. So, no, my specifications mentions
nothing about time zones; and, I doubt anyone will suffer too
terribly if they ignore this issue. But, I think it is perfectly safe to
say that it will not hurt anyone to consider this issue, and could only
help under the general considerations. But, of course, there are a
diverse set of opinions on this type of issue which have been written
about extensively in previous threads.
Also, anyone who has ever written a distributed, company-wide
application these days, probably has to consider time zones.
Thanks,
Javini Javono
[ January 20, 2004: Message edited by: Javini Javono ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic