Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これはどこかにあるはずですが、GregorianCalendar クラスはどの曜日が週の最初の日かをどのように判断するのでしょうか? これは Locale によって行われますか、それとも静的なままですか?
私が最終的にやろうとしているのは、米国の週末かどうかを判断するためのテストです。ポインタはありますか?
GregorianCalendar は Locale によって決定します。
あなたは何かをすることができます。
GregorianCalendar cal = new GregorianCalendar(someTimezone, Locale.US); int day = cal.get(Calendar.DAY_OF_WEEK); if (day == Calendar.SATURDAY || day == Calendar.SUNDAY) { // do something interesting }