-
Calendar
Hello,
I'm looking for classes that inherit from the Calendar classe and who
includes official day off for every country.
Does anyone know if this classe exist or where can I found it....
Thanks.
-
Re: Calendar
hi Joseph,
You could use the GregorianCalendar class which is a subclass of Calendar
in conjuction with the TimeZone class to create Calendar objects set to a
specific country's time.
For example to create a Calendar object which stores the Pacific Time:
// create a Pacific Standard Time time zone
SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
// set up rules for daylight savings time
pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
// create a GregorianCalendar with the Pacific Daylight time zone
// and the current date and time
Calendar calendar = new GregorianCalendar(pdt);
Hope that helped.
Vikram
-
Re: Calendar
Thank you for this response...
But, it's not exactly what I need. I'm looking for a special Calendar that
can provide official day off in a country.
For example :
The official birthday date of America is the 4 july, and it's a day off
for every people is this country.
In other country the official birthday date can be something else, like
in Switzerland where this date is the 1 august.
So, I'm looking for a class calendar which can say if a date in a special
country is a day off or not...
Thank you and excuse for my (so poor) english ...
Vikram Rajan wrote in message <39d36e8f$1@news.devx.com>...
>
>hi Joseph,
>
>You could use the GregorianCalendar class which is a subclass of Calendar
>in conjuction with the TimeZone class to create Calendar objects set to a
>specific country's time.
>
>For example to create a Calendar object which stores the Pacific Time:
>
>// create a Pacific Standard Time time zone
>SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
>// set up rules for daylight savings time
>pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
>pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
>// create a GregorianCalendar with the Pacific Daylight time zone
>// and the current date and time
>Calendar calendar = new GregorianCalendar(pdt);
>
>
>Hope that helped.
>
>Vikram
>
-
Re: Calendar
The Calendar class itself doesn't have a method isHoliday() or anything like
that. You might find something at IBM's Alphaworks site
(www.alphaworks.ibm.com); IBM is very good on the international aspects of
systems.
PC2
Joseph Berdat <jberdat@eim.ch> wrote in message
news:39d1b780@news.devx.com...
> Hello,
> I'm looking for classes that inherit from the Calendar classe and who
> includes official day off for every country.
> Does anyone know if this classe exist or where can I found it....
> Thanks.
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks