我想在年月日在JavaScript計算時間 function getMonthsBetween (date1, date2)
{
'use strict';
// Months will be calculated between start and end dates.
// Make sure start date is less than end date.
我使用TimeUnit在我的Android應用程序之一中使用了TimeUnit。但是我成功了幾天...我想要它直到月和年。我的功能如下....任何人都可以建議我如何增加到一年? private String displayQuoteTime(long seconds) {
int day = (int) TimeUnit.SECONDS.toDays(seconds);
lo
使用LocalDate,我得到了在Period實例中表達的差異。例如: LocalDate born = LocalDate.of(1990, Month.SEPTEMBER, 30);
Period myAge = Period.between(born, LocalDate.now());
System.out.println("My age is: "+myAge.getYears()+