TimeZone Issue

J

jagadesh

HI everyOne ,

i have developed a appointment sort of web appliation. my problem is
whenever i create a appointment in india ,it get saved in server which
is in chicago. if i create a n appointment on 9 am today . it saves in
server.but when a person in chicago opens the appointment , the
appointment creation time and date are different .since the timezones
are different .

How can i handle this Situation ?


thank u,
jagadesh
 
R

Roedy Green

i have developed a appointment sort of web appliation. my problem is
whenever i create a appointment in india ,it get saved in server which
is in chicago. if i create a n appointment on 9 am today . it saves in
server.but when a person in chicago opens the appointment , the
appointment creation time and date are different .since the timezones
are different .

How can i handle this Situation ?

Presuming you have control of client and server code, store the time
it UTC, then convert it to the locale of wherever the user is.

If you are using an Applet, the default TimeZone will automatically be
India.

If you are using just a browser, you will need to have some sort of
account with the server, and configure your preferred timezone. You
will notice nearly all the Forums doing this.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Danish studies of 10,000 birds killed revealed that almost all died in
collisions with buildings, cars and wires; only 10 were killed by windmills.
Alternative energy sources are absolutely necessary.
Global warming will kill birds and bats, as well as other species,
in much greater numbers than wind power."
~ Dr. David Suzuki
 
T

Tom Anderson

i have developed a appointment sort of web appliation. my problem is
whenever i create a appointment in india ,it get saved in server which
is in chicago. if i create a n appointment on 9 am today . it saves in
server.but when a person in chicago opens the appointment , the
appointment creation time and date are different .since the timezones
are different .

Yes. The time and date *are* different, because the timezones are
different. That's correct behaviour. What were you expecting?

tom
 
R

Roedy Green

i have developed a appointment sort of web appliation. my problem is
whenever i create a appointment in india ,it get saved in server which
is in chicago. if i create a n appointment on 9 am today . it saves in
server.but when a person in chicago opens the appointment , the
appointment creation time and date are different .since the timezones
are different .

An appointment to meet for a phone call exists is a point in time. The
people in India and the people in Chicago have may have a different
date and will have a different time to describe that instant. That's
just one of the quirks of a spherical rotating earth.

It you wanted for example to say that Christmas happen on Dec 25 both
in India and Chicago, you are not talking about an instant in time.
You are talking about a civic event, a pure date. In that case time
and timezone are irrelevant. BigDate was invented to handle such
dates simply. You can do it with Java date/times but you spend 90% of
your effort trying to get rid of the time and timezone.

See http://mindprod.com/jgloss/bigdate.html
http://mindprod.com/jgloss/calendar.html

--
Roedy Green Canadian Mind Products
http://mindprod.com

"Danish studies of 10,000 birds killed revealed that almost all died in
collisions with buildings, cars and wires; only 10 were killed by windmills.
Alternative energy sources are absolutely necessary.
Global warming will kill birds and bats, as well as other species,
in much greater numbers than wind power."
~ Dr. David Suzuki
 
A

Arne Vajhøj

jagadesh said:
i have developed a appointment sort of web appliation. my problem is
whenever i create a appointment in india ,it get saved in server which
is in chicago. if i create a n appointment on 9 am today . it saves in
server.but when a person in chicago opens the appointment , the
appointment creation time and date are different .since the timezones
are different .

How can i handle this Situation ?

How do you manage not to handle it.

java.util.Date operate in UTC and if you store the the time
in something UTC compatible, then both India and Chicago will
see the same time formatted after local timezone, which is what
makes sense.

Arne
 
L

Lew

Roedy said:
It you wanted for example to say that Christmas happen on Dec 25 both
in India and Chicago, you are not talking about an instant in time.
You are talking about a civic event, a pure date. In that case time
and timezone are irrelevant. BigDate was invented to handle such
dates simply. You can do it with Java date/times but you spend 90% of
your effort trying to get rid of the time and timezone.

<https://jsr-310.dev.java.net/nonav/doc-2008-08-04/javax/time/calendar/LocalDate.html>
 
C

clarity

HI everyOne ,

i have developed a appointment sort of web appliation. my problem is
whenever i create a appointment in india ,it get saved in server which
is in chicago. if i create a n appointment on 9 am today . it saves in
server.but when a person in chicago opens the appointment , the
appointment creation time and date are different .since the timezones
are different .

How can i handle this Situation ?

thank u,
jagadesh

Here are a couple of examples of how you can specify a timezone
http://www.exampledepot.com/egs/java.util/GetAllZones.html
http://www.exampledepot.com/egs/java.util/GetTimeOtherZone2.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top