相关疑难解决方法(0)

为JodaTime Instant添加一些天

我试图写一个简单实用的方法添加的天数aninteger的乔达时间瞬间.这是我的第一次尝试.

/**
 * Adds a number of days specified to the instant in time specified.
 *
 * @param instant - the date to be added to
 * @param numberOfDaysToAdd - the number of days to be added to the instant specified
 * @return an instant that has been incremented by the number of days specified
 */
public static Instant addNumberOfDaysToInstant(final Instant instant, final int numberOfDaysToAdd) {
    Days days = Days.days(numberOfDaysToAdd);
    Interval interval = new Interval(instant, days);
    return interval.getEnd().toInstant(); …
Run Code Online (Sandbox Code Playgroud)

java datetime jodatime

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

datetime ×1

java ×1

jodatime ×1