[英]How to get Calendar Object from webservice request?
I am giving 1999-12-12 as input of type date in the soap request. 我在肥皂请求中提供了1999-12-12作为类型日期的输入。 I deployed the webservice in IBM JAXRPC.
我在IBM JAXRPC中部署了Web服务。 In the request object, i am getting as Calendar object.
在请求对象中,我将作为Calendar对象。 If the get the Month of the input using Calendar.Month, i am getting 11 as month value.
如果使用Calendar.Month获取输入的月份,我将获得11作为月份值。 But my month value is 12.
但是我的月份值为12。
Please tell me why i am getting the value as 11 not 12. 请告诉我为什么我得到11而不是12的值。
Months in a Calendar
object are 0-indexed, meaning January would be 0 and December would be 11. Calendar
对象中的月份是0索引的,这意味着1月将是0,12月将是11。
From the docs: 从文档:
MONTH
月
public static final int MONTH
公共静态最终诠释MONTH
Field number for get and set indicating the month.
get和set的字段号指示月份。 This is a calendar-specific value.
这是日历特定的值。 The first month of the year is JANUARY which is 0;
一年的第一个月是1月,0。 the last depends on the number of months in a year.
最后一个取决于一年中的月份数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.