Handling of DST in java

R

Raymond DeCampo

Stefan said:
Something like this is done here for the closing-time of
stores. So, since the government already enforces
opening-times and closing-times of stores, they could change
these and they could change to times for schools, universities
and their own agencies. Some other institutions then might
follow.

By "here", I assume you mean Germany, based on what you wrote below.
There are no such laws in the US with the exception of some states that
have "blue laws" that only apply on Sundays.

Your suggestion sounds like a nightmare where you never know what is
going to be available when.
It is only that, given two time stamps of the legal time for
a location in Germany, like

2005-07-10T21:38:10 and
1960-07-10T21:38:13

it would be a typical programming task to write a routine
that can calculate the difference between them in seconds.
And this would be much more easy, without the need to have
to find out all details of regulations for DST in Germany.

After WWII, in Germany, there were several different zones
controlled by different countries and some details for the DST
differed between these zones. In one zone, there was a special
DST with two hours added for the mid of summer. Then there are
reports that there were years with DST even in winter. And so
on.

All these special regulations make it very difficult to
write such a routine.

This is why any environment worth its salt has these routines available
in a standard library. Asking people to forgo a substantial reduction
in energy use for the (supposed) convenience of computer programmers is
ridiculous. Remember that computers are not an end unto themselves,
they are tools here to serve.

Ray
 
R

Roedy Green

speed limit would change

I wonder how soon it will be economical to replace all painted speed
limit signs with electronic ones that can be controlled to give
sensible numbers depending on visibility, slipperiness, nearby
accidents and simply to optimally regulate traffic flow to prevent
congestion. You could also have a sign an freeway on ramp to let you
know when an open slot was coming, and to ramp up to speed to meet it,
or to just stay off the freeway for a while since adding more cars
would reduce the aggregate flow.

It blows my mind how people insist on driving the speed limit in the
slickest ice, on the first snow when people are caught without snow
tires, or in pea-soup fog. You sometimes get multiple car pileups as a
result.
 
O

Oliver Wong

Raymond DeCampo said:
I think that it is clear that the statement above compares daylight saving
time to the lack of daylight saving time.

Why would DST result in energy savings? (Not rhetorical, I really don't
know)

- Oliver
 
N

nag

Hi ,
Thanks very much.
This is right that JAVA gregorian calendar has got this bug. When DST occurs
in Iran ( time 23:59:59 -> 01:00:00) the calendar returns wrong time. But it
works when DST occurs in Egypt ( time 23:59:59 -> 01:00:00).
 
Joined
Aug 6, 2010
Messages
2
Reaction score
0
Handling Daylight saving time in java application

Hi,

How to handle daylight saving time problem when converting between time zones in java application as java api is not reliable for this?What is the best way to avoid time mismatch.


Thanks & Regards
Yogendra Rishishwar
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top