Get amount of this Duration in days
@return
964990
public int getDays() {
		switch (_units) {
		case Days:
			return _amount;
		case Weeks:
			return _amount * 7;
		case Months:
			if (_amount <= 1)
				return _amount * 30;
			else if (_amount < 12)
				return (_amount * 61) / 2;
			else
				return (_amount * 365) / 12;
		default:
			throw new UnsupportedOperationException();
		}
	}
1084858
public long getTimeRemainingInMillis()
    {
        long batchTime = System.currentTimeMillis() - startTime;
        double timePerIteration = (double) batchTime / (double) worked.get();
        return (long) (timePerIteration * (total - worked.get()));
    }
654101
public long getMin() {
		for (int i = 0; i < hits.length(); i++) {
			if (hits.get(i) > 0) {
				return i == 0 ? 0 : 1 + bins[i - 1];
			}
		}
		return 0;
	}
1276271
public static DayOfWeek plus(final DayOfWeek self, int days) {
        int daysPerWeek = DayOfWeek.values().length;
        int val = ((self.getValue() + days - 1) % daysPerWeek) + 1;
        return DayOfWeek.of(val > 0 ? val : daysPerWeek + val);
    }
182625
public function days()
    {
        if (!isset($this->days)) {
            $clonedStart = clone $this->weekStart;
            $this->days = array();
            for ($i = 0; $i < 7; $i ++) {
                $thisDay = new Day($clonedStart);

                if (
                    $this->containingMonth
                    && $this->containingMonth->firstDay()->format('m') != $clonedStart->format('m')
                ) {
                    $thisDay->setIsOverflow(true);
                }

                $this->days[] = $thisDay;
                $clonedStart->modify('+1 day');
            }
        }
        return $this->days;
    }
739476
public function getRemainingSuspensionTime()
	{
		if(!$this->isSuspended())
			return 0;

		$lastAttempt = clone $this->last_attempt_at;

		$suspensionTime  = static::$suspensionTime;
		$clearAttemptsAt = $lastAttempt->modify("+{$suspensionTime} minutes");
		$now             = new Datetime;

		$timeLeft = $clearAttemptsAt->diff($now);

		$minutesLeft = ($timeLeft->s != 0 ?
						($timeLeft->days * 24 * 60) + ($timeLeft->h * 60) + ($timeLeft->i) + 1 :
						($timeLeft->days * 24 * 60) + ($timeLeft->h * 60) + ($timeLeft->i));

		return $minutesLeft;
	}
501443
public static String getUpTime() {
        long diff = ManagementFactory.getRuntimeMXBean().getUptime();
        diff /= 1000 * 60;
        long minutes = diff % 60;
        diff /= 60;
        long hours = diff % 24;
        diff /= 24;
        long days = diff;
        StringBuilder buf = new StringBuilder();
        if (days == 1) {
            buf.append("1 day ");
        } else if (days > 1) {
            buf.append(Long.valueOf(days).toString()).append(" days ");
        }
        DecimalFormat format = new DecimalFormat();
        format.setMinimumIntegerDigits(2);
        buf.append(format.format(hours)).append(":")
                .append(format.format(minutes));
        return buf.toString();
    }
876576
public static Long getSunday() {
		cal.setTimeInMillis(System.currentTimeMillis());
		cal.add(Calendar.DATE, -dayOfWeek() + 7);
		return cal.getTimeInMillis();
	}
163540
public static long todayEndSeconds(){
		Date curTime = new Date();
		return DateUtils.getDiffSeconds(DateUtils.getDayEnd(curTime), curTime);
	}
403804
public int lengthOfMonth() {

        try {
            PlainDate min = this.with(DAY_OF_MONTH, this.getMinimum(DAY_OF_MONTH).intValue()).gregorian;
            PlainDate max = this.with(DAY_OF_MONTH, this.getMaximum(DAY_OF_MONTH).intValue()).gregorian;
            return ((int) CalendarDays.between(min, max).getAmount()) + 1;
        } catch (RuntimeException re) {
            return -1; // only in very exotic circumstances
        }

    }
699978
public function getDays()
	{
		return @isset( $this->Value->daysOnly ) && $this->Value->daysOnly && $this->Value->days ? $this->Value->days : $this->Value->d;
		return $this->Value->d;
	}
24461
public D plus(D duration) {

        if (duration.isEmpty()) {
            return this.self();
        }

        long value = this.amount;
        return this.with(MathUtils.safeCast(value + duration.getAmount()));

    }
516701
public static Long getMonth1stDay() {
		cal.setTimeInMillis(System.currentTimeMillis());
		cal.set(Calendar.DATE, 1);
		return cal.getTimeInMillis();
	}
917649
private static BigDecimal computeSeconds(Duration d) {
    return d.getSeconds().add(new BigDecimal(d.getDays().multiply(BigInteger.valueOf(24))
                                             .add(d.getHours()).multiply(BigInteger.valueOf(60))
                                             .add(d.getMinutes()).multiply(BigInteger.valueOf(60))));
  }
1359650
public long toNanoOfDay() {
        long total = hour * NANOS_PER_HOUR;
        total += minute * NANOS_PER_MINUTE;
        total += second * NANOS_PER_SECOND;
        total += nano;
        return total;
    }
783046
public long getCount(long toWhen, long period, TimeUnit unit) {
		return getCount(toWhen - TimeUnit.MILLISECONDS.convert(period, unit), toWhen);
	}
571705
public function trialDaysRemaining(): int
    {
        if (($days = &$this->cacheKey(__FUNCTION__)) !== null) {
            return $days; // Cached already.
        }
        if ($this->App->is_core) {
            return $days = -1; // Not applicable.
        } elseif ($this->App->Config->§specs['§in_wp']) {
            return $days = -1; // Not applicable.
        } elseif (!$this->App->Config->§specs['§is_pro'] && !$this->App->Config->§specs['§is_elite']) {
            return $days = -1; // Not elite/pro version.
        } elseif ($this->App->Config->§options['§license_key']) {
            return $days = -1; // Have license key.
        } elseif (!in_array($this->App->Config->§specs['§type'], ['theme', 'plugin'], true)) {
            return $days = -1; // Only applies to themes & plugins.
        } elseif (!$this->App->Parent || !$this->App->Parent->is_core) {
            return $days = -1; // Not applicable.
        }
        if (!$this->history['first_time']) {
            return $days = $this->trial_days;
        }
        $time        = time(); // Current time.
        $exp_time    = strtotime('+'.$this->trial_days.' days', $this->history['first_time']);
        return $days = $exp_time > $time ? min($this->trial_days, (int) ceil($exp_time - $time)) : 0;
    }