我正在嘗試更改XMLGregorianCalendar日期的格式。在我的模式文件(的.xsd)的代碼是這樣的: <xs:element name="LatestSaleDate">
<xs:annotation>
<xs:documentation>Latest sale date on the property (format MM/DD/YYYY)</xs:documen
問題: CalendarTest.java:9: error: cannot find symbol
int today = d.get(Calendar.DAY_OF_MONTH);
^
symbol: method get(int)
location: variable d of type GregorianCalendar
我的代碼: import java.
我有點困惑。我一直在使用Java中的Calendar和GregorianCalendar類,並且我一直在打印這個小時,但它說的是4,現在是11。 我的問題是,是基於當地時間的小時?它是基於特定時區嗎? 我環顧四周,但我還沒有找到明確的答案。 Calendar today = new GregorianCalendar();
int y = today.get(Calendar.YEAR)