*
The moose likes Java in General and the fly likes Day light support in JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Day light support in JAVA" Watch "Day light support in JAVA" New topic
Author

Day light support in JAVA

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Hello ALL,

I looked at the below link for daylight support for java on sun site.

http://java.sun.com/developer/technicalArticles/Intl/USDST/

How do I test it. Has anyone done this before. I have downloaded the tool that is mentioned on the above site.
I ran the validation. everything looks good. But How do I verify that It works?

Any pointers appreciated.

Thanks,
Trupti
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

The same way you determine whether anything works.

1. Determine the requirements, i.e. figure out what things it is supposed to do.

2. Write test code that tries to make it do those things.

3. Run that test code.

4. See if it did those things as expected and report whether it did.
Rachil Chandran
Ranch Hand

Joined: Mar 05, 2006
Posts: 67
The new DST rules specify march 11th (instead of april 2nd) as the day the clock should be changed (similarly november 4th instead of october 29th).

One way to check this is to write a program that prints the current time. Then update the date to march 10th, check the time to verify. Change the date again to march 11th and check that the time has changed in accordance to DST.


SCJP2 96%
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Originally posted by Rachil Chandran:
The new DST rules specify march 11th (instead of april 2nd) as the day the clock should be changed (similarly november 4th instead of october 29th).

One way to check this is to write a program that prints the current time. Then update the date to march 10th, check the time to verify. Change the date again to march 11th and check that the time has changed in accordance to DST.



That is what I did and tested a simple program. I user jre 1.3.13 and jre 1.5 with updated TZ DB. But I do not see any date changes.

Thanks,
Trupti
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

Originally posted by trupti nigam:



That is what I did and tested a simple program. I user jre 1.3.13 and jre 1.5 with updated TZ DB. But I do not see any date changes.

Thanks,
Trupti


Trupti,
Is the time zone of your test machine set to the time zone you want to test, or did you define the time zone in your test program?

The Novell support site has a nice test that shows if a Daylight Saving offset change occurs at a particular moment.

It uses the time zone database of the java runtime that's running the program.
You pass the timezone, and a date. The test tells wether a DST change occurs at that date.

Regards, Jan
[ January 29, 2007: Message edited by: Jan Cumps ]

OCUP UML fundamental and ITIL foundation
youtube channel
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Originally posted by Jan Cumps:


Trupti,
Is the time zone of your test machine set to the time zone you want to test, or did you define the time zone in your test program?

The Novell support site has a nice test that shows if a Daylight Saving offset change occurs at a particular moment.

It uses the time zone database of the java runtime that's running the program.
You pass the timezone, and a date. The test tells wether a DST change occurs at that date.

Regards, Jan

[ January 29, 2007: Message edited by: Jan Cumps ]



Thanks Jan.
The code did work this time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Day light support in JAVA
 
Similar Threads
which JDK version(s) need to be upgraded for daylight saving problem ?
Daylight saving issue.
Daylight saving issue with JRE
Problem with "America/Los_Angeles" Time Zone
Log4j time problem in Solaris