如何在java中使用joda计时

时间:2015-06-16 13:52:17

标签: java jodatime

目前我正在使用日历类型..

GregorianCalendar gcalendar = new GregorianCalendar();
// Display current time and date information.

System.out.print("Date: ");
System.out.print(gcalendar.get(Calendar.MONTH)+1);
//System.out.print(Calendar.MONTH);
System.out.print(" " + gcalendar.get(Calendar.DATE) + " ");
System.out.println(year = gcalendar.get(Calendar.YEAR));

System.out.print("Time: ");
System.out.print(gcalendar.get(Calendar.HOUR_OF_DAY) + ":");
//System.out.print(Calendar.HOUR + ":");
System.out.print(gcalendar.get(Calendar.MINUTE) + ":");
System.out.println(gcalendar.get(Calendar.SECOND));

我想使用joda计时... 我该怎么办..

1 个答案:

答案 0 :(得分:0)

您还没有说明在哪种情况下您会使用 Joda-Time 库,但基本知识在the website中说明。

Here您还可以参考如何使用 Joda-Time If result = "Closed" Then Cells(j, 3) = "B" ws1.Cells(i, 22).Interior.ColorIndex = 3 'Red If Cells(i, 1) = 2016 Then ws1.Cells(x, y).Interior.ColorIndex = 46 'you need to specify where Employee ID column is with replacing x and y End If 'copy row to the other tab For Each c In ws1.Rows(i) ws3.Cells(k + 2, c.Column) = c Next k = k + 1 End If ,这是图书馆背后的一个关键概念(我强烈建议您阅读基础)。这里是使用 Gregorian 日历的示例:

Chronology