Calendar


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Calendar

  1. #1
    Joseph Berdat Guest

    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.




  2. #2
    Vikram Rajan Guest

    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


  3. #3
    Joseph Berdat Guest

    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
    >




  4. #4
    Paul Clapham Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center