${log.root}/lowem.log
Inflation, Investing and Everything


All | Energy | Java | Tech | Musings | Env | Biz

AddThis Feed Button
20050422 Friday April 22, 2005

Energy Bill : JDK update required?

Just came across this article "Energy Bill at a Glance". I would have put this under the Energy category ("open Arctic National Wildlife Refuge in Alaska to oil drilling", "$8.1 billion in tax breaks ... for oil, gas, nuclear, coal and electric utilities", yada).

Till I came across this one - "expand daylight-saving time by two months, so it would start on the first Sunday in March and end on the last Sunday in November." Yikes! What would that mean for our computer systems, and to the Java JDK's we've been using? Is a JDK update required to support this?

freerepublic.com has a post on this (excerpt) :

The last time the United States changed its timezone rules was back in 1987. But the way computer programs typically deal with dates and times is substantially different from 1987. Should Congress actually change the rules, the impact would be much greater today than it was in 1987. Back in 1987, most systems and applications stored timestamps relative to local time, not relative to GMT. The reverse is true today, and the consequences are non-trivial.

Java embeds the timezone offset rules in the JDK codebase ("rt.jar.") Consequently, Sun would have to publish a new version of the rt.jar file--which they would probably do only for the latest version of Java.

Java only deals with the current offset rules. It cannot apply different rules for timestamps in different timeperiods (e.g., pre-1967, 1967-1973, 1974, 1975, 1976-1986, 1987-2005, 2006-??) Worse, Java always represents timestamps as a number of milliseconds since 1 January 1970 GMT, and converts to local time only when the timestamp is displayed. Consequently, any future dates represented as Java Date or Calendar instances reflect the GMT time for that LOCAL date (or moment in time) based on the timezone rules that were encoded into the rt.jar file when the Date or Calendar instance was created, not based on any FUTURE timezone rules. This means that any timestamps in the past for March or November would have their local time shifted forward by one hour. The same applies to any dates already created for any future March or November. "12:01 am" would become "1:01 am."

See also :

1. Daylight Savings Change Proposed (slashdot.org)

(2005-04-22 17:13:08 SGT) [Java] Permalink

Comments:

Post a Comment:

Comments are closed for this entry.

Your Ad Here


Most popular blog postings on lowem.log :

1. Singapore MRT rail network length to double by 2020
2. 2010 Nissan Leaf electric car specifications : 107hp, 24KWh lithium-ion batteries, 100-mile range
3. Live spot gold price quotes chart on COMEX
4. 2010 Toyota Prius specifications released : 50 mpg, 1.8L, 134hp, Ni-MH, solar roof option
5. AVG Anti-Virus Free Edition 2011 direct download link
6. Real-time live gold and silver price quotes chart on COMEX
7. Singapore electric vehicles : Government agencies EMA and LTA to study EV introduction
8. Book review : Shut Down by William Flynn

Featured articles on lowem.log :

1. Book review : Shut Down by William Flynn
2. Singapore electric cars testing starts with 9 electric vehicles
3. Honda, GS Yuasa JV to make lithium-ion batteries for 2010/2011 Honda Civic Hybrid
4. 2010 Honda Civic Hybrid preliminary specifications released
5. 2010 Honda CR-Z hybrid, 2010 Honda Fit/Jazz hybrid models confirmed
6. 2010 Toyota Prius specifications released : 50 mpg, 1.8L, 134hp, Ni-MH, solar roof option
7. NYMEX crude oil recovers from $32.40 low after 2.2 mbpd OPEC production cut announced
8. Singapore : Nuclear power not ruled out



search
sponsored links


bookmarks

about
my profile
contact me

blogroll
biow/ken/wenn
reviewem
dividend investing

sites
photo gallery
wiki

quotes
live oil prices
live gold prices

charts
live forex rates
live oil chart
live brent crude chart
live gold chart
live silver chart

historical
crude oil chart
gold chart
silver chart


navigation
decals

Click for Singapore, Singapore Forecast





rss feed for lowem.log

Get Firefox!

powered by
hosted by