Returns a Period instance.

- the starting datepoint represents the beginning of the current datepoint second
- the duration is equal to 1 second
15013
public function getSecond(): Period
    {
        $datepoint = $this->setTime(
            (int) $this->format('H'),
            (int) $this->format('i'),
            (int) $this->format('s')
        );

        return new Period($datepoint, $datepoint->add(new DateInterval('PT1S')));
    }
1037126
def iterperiods(self, start=None, end=None, value=None):
        
        start, end, mask = \
            self._check_boundaries(start, end, allow_infinite=False)

        value_function = self._value_function(value)

        # get start index and value
        start_index = self._d.bisect_right(start)
        if start_index:
            start_value = self._d[self._d.iloc[start_index - 1]]
        else:
            start_value = self.default

        # get last index before end of time span
        end_index = self._d.bisect_right(end)

        interval_t0, interval_value = start, start_value

        for interval_t1 in self._d.islice(start_index, end_index):

            if value_function(interval_t0, interval_t1, interval_value):
                yield interval_t0, interval_t1, interval_value

            # set start point to the end of this interval for next
            # iteration
            interval_t0 = interval_t1
            interval_value = self[interval_t0]

        # yield the time, duration, and value of the final period
        if interval_t0 < end:
            if value_function(interval_t0, end, interval_value):
                yield interval_t0, end, interval_value
609812
public function getIsoYear(): Period
    {
        $year = (int) $this->format('o');
        $datepoint = $this->setTime(0, 0);

        return new Period($datepoint->setISODate($year, 1, 1), $datepoint->setISODate(++$year, 1, 1));
    }
611659
def get_period(date_from: date, date_to: date) -> str:
    
    assert isinstance(date_from, date)
    assert isinstance(date_to, date)

    str_from: str = date_from.isoformat()
    str_to: str = date_to.isoformat()

    return str_from + " - " + str_to
362140
public static PeriodDuration of(Duration duration) {
        Objects.requireNonNull(duration, "The duration must not be null");
        return new PeriodDuration(Period.ZERO, duration);
    }
1114050
def get_start_date(self):
        
        sdate = self._my_map['startDate']
        return DateTime(
            sdate.year,
            sdate.month,
            sdate.day,
            sdate.hour,
            sdate.minute,
            sdate.second,
            sdate.microsecond)
644521
def get_formula(self, period = None):
        

        if not self.formulas:
            return None

        if period is None:
            return self.formulas.peekitem(index = 0)[1]  # peekitem gets the 1st key-value tuple (the oldest start_date and formula). Return the formula.

        if isinstance(period, periods.Period):
            instant = period.start
        else:
            try:
                instant = periods.period(period).start
            except ValueError:
                instant = periods.instant(period)

        if self.end and instant.date > self.end:
            return None

        instant = str(instant)
        for start_date in reversed(self.formulas):
            if start_date <= instant:
                return self.formulas[start_date]

        return None
795509
function() {
      return ICAL.Period.fromData({
        start: this.start ? this.start.clone() : null,
        end: this.end ? this.end.clone() : null,
        duration: this.duration ? this.duration.clone() : null
      });
    }
453821
def parse_period(period: str):
    
    period = period.split(" - ")

    date_from = Datum()
    if len(period[0]) == 10:
        date_from.from_iso_date_string(period[0])
    else:
        date_from.from_iso_long_date(period[0])
    date_from.start_of_day()

    date_to = Datum()
    if len(period[1]) == 10:
        date_to.from_iso_date_string(period[1])
    else:
        date_to.from_iso_long_date(period[1])
    date_to.end_of_day()

    return date_from.value, date_to.value
559451
public Date getFrom() {
        final TimeInterval first = intervals.first();
        if (first != null) {
            return new Date(first.getFrom());
        }
        return null;
    }
865700
public function getMonth(): Period
    {
        $startDate = $this
            ->setTime(0, 0)
            ->setDate((int) $this->format('Y'), (int) $this->format('n'), 1);

        return new Period($startDate, $startDate->add(new DateInterval('P1M')));
    }
1197343
function () {
    
                var start = new Date(),
                    retval = method.apply(this, arguments),
                    stop = new Date();
                
                saveDataPoint(name, stop-start);
                
                return retval;                
            
            }
41327
public function getIsoWeek(): Period
    {
        $startDate = $this
            ->setTime(0, 0)
            ->setISODate((int) $this->format('o'), (int) $this->format('W'), 1);

        return new Period($startDate, $startDate->add(new DateInterval('P7D')));
    }
762525
public static long periodEnd(long now, long period)
  {
    QDate localCalendar = QDate.allocateLocalDate();
    
    long endTime = periodEnd(now, period, localCalendar);
    
    QDate.freeLocalDate(localCalendar);
    
    return endTime;
  }
1058809
def period(self):
        
        return timedelta(seconds=2 * np.pi * np.sqrt(self.kep.a ** 3 / self.mu))
223394
def duration(self):
        
        if self.end_datetime is None or self.start_datetime is None:
            return 0
        return (self.end_datetime - self.start_datetime).total_seconds()
1069382
public static PeriodDuration of(Period period) {
        Objects.requireNonNull(period, "The period must not be null");
        return new PeriodDuration(period, Duration.ZERO);
    }