I seem to be having a problem with getting the month value from an XmlCalendar
object. For example, if I have a XmlObject (sourceMember) that contains a
"date" attribute:
Calendar metDate = sourceMember.getDate();
System.out.println(metDate);
System.out.println((metDate.get(Calendar.YEAR) + ", " +
metDate.get(Calendar.MONTH) + ", " +
metDate.get(Calendar.DATE)));
Produces the following output:
1999-09-12-07:00
1999, 8, 12
Regardless of the value of the attribute, the metDate.get(Calendar.MONTH)always
returns a month value that is one month less than it should be. Is this a bug,
or am I doing something wrong?
Any suggestions?
David Lewis
Software Developer - National Forest Information System/
Concepteur de logiciels - Système national d'information forestière
Natural Resources Canada Ressources naturelles Canada
Canadian Forest Service. Service canadien des forêts
506 West Burnside Road 506, chemin ouest Burnside
Victoria, B.C. V8Z 1M5 Victoria, (C.-B.), V8Z 1M5
Telephone: (250) 363 0710 Téléphone: (250) 363 0710
Facsimile: (250) 363 0775 Télécopier: (250) 363 0775
Email: dlewis@ pfc.cfs.nrcan.gc.ca Courriel: [EMAIL PROTECTED]
NFIS Website / SNIF Site Web: http://nfis.org/ <http://nfis.org/>
PFC Website / CFP Site Web: http://cfs.nrcan.gc.ca/regions/pfc
<http://cfs.nrcan.gc.ca/regions/pfc>