编辑:谢谢-我现在明白了很多。当你第一次开始时,它非常混乱!谢谢您的帮助。我将按原样保持这个问题(冒着更多反对票的危险),因为它可能会帮助其他人。每个人似乎都推荐其他一些用于日期时间的库
我正在努力使用 Java 日历功能-它似乎返回了错误的数据,根据日历,底部的数字应该是星期四,但返回的是星期六!
Calendar cal = new GregorianCalendar();
cal.set(2012,2,23); // 0 = January
String weekdays[]={"sunday","monday", "tuesday", "wednesday","thursday","friday","saturday",};
Integer Weekdaycurrent1=cal.get(Calendar.DAY_OF_WEEK);
System.out.println("today is a "+weekdays[Weekdaycurrent1]); //Prints today is Saturday, when it should be a thursday