Forums Register Login

Problem with the Calendar

+Pie Number of slices to send: Send
Hi, I am using the Calendar to setup a date string to display and I obtain each part separately using the Calendar.getInstance.get() method and passing it the DAY_OF_MONTH, MONTH, YEAR variables. The problem is I am currently getting a 0 for month. What I am doing wrong ?
Thanks
Daniel Serrano
+Pie Number of slices to send: Send
You're doing nothing wrong. For some reason, Calendar uses a 0-based index for months. I.e. 0=January, 1=February, 2=March and so on.
+Pie Number of slices to send: Send
Thanks a lot, it would probably have taken me some time to figure that out as I was assuming there was a problem and Calendar was only returning the first digit of the month. Thanks.
Straws are for suckers. Now suck on this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 645 times.
Similar Threads
restricted calendar display
How to stop flickering?!!
Calendar utility(urgent)
Ajax+Calendar
week days
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:04:43.