Returns a new instance with the date set to 1st of the current month and time set to midnight.

@return self
505916
public function withDateAtStartOfMonth() : self
    {
        $instance = $this->withTimeAtMidnight();
        
        $instance->date->setDate($instance->year(), $instance->month(), 1);
        
        return $instance;
    }
288342
public function build(): SetTimeDomainRequest
	{
		$instance = new SetTimeDomainRequest();
		if ($this->timeDomain === null) {
			throw new BuilderException('Property [timeDomain] is required.');
		}
		$instance->timeDomain = $this->timeDomain;
		return $instance;
	}
1049631
public static function thisWeek()
    {
        $start = CarbonDate::today();
        $end = CarbonDate::tomorrow();
        if ($start->dayOfWeek !== CarbonDate::MONDAY) {
            $start->modify('last monday');
        }

        return new static($start, $end);
    }
127557
public static Date getNextDay() {

        Calendar cal = GregorianCalendar.getInstance();
        return new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH),
                                        cal.get(Calendar.DAY_OF_MONTH) + 1).getTime();

    }
561844
public function getStart() {
		return Util::toISO8601($this->getStartTimestamp(), Util::UTC, $this->getEvent()->getTimezone());
	}
649684
public static function fromNative()
    {
        $args = func_get_args();

        $hour   = new Hour($args[0]);
        $minute = new Minute($args[1]);
        $second = new Second($args[2]);

        return new static($hour, $minute, $second);
    }
1130761
public function today(): AbstractCalendarDate
    {
        $tmp        = clone $this;
        $ymd        = $tmp->todayYmd();
        $tmp->year  = $ymd[0];
        $tmp->month = $ymd[1];
        $tmp->day   = $ymd[2];
        $tmp->setJdFromYmd();

        return $tmp;
    }
143257
public static function create($year, $month, $day, $hour, $minute, $second)
    {
        return new static($year, $month, $day, $hour, $minute, $second);
    }
922429
protected function dateTime(): DateTimeImmutable
    {
        if ($this->dateTime === null) {
            $year = $this->year();
            $month = $this->month();
            $day = $this->day();
            $hour = $this->hour();
            $minute = $this->minute();
            $second = $this->second();
            $timezone = $this->timezone()->toString();
            $this->dateTime = self::createNative($year, $month, $day, $hour, $minute, $second, $timezone);
        }

        return $this->dateTime;
    }
761497
public function setStartDate($date)
    {
        $date = AnDomainAttributeDate::getInstance()->setDate($date);
        $this->set('startDate', $date);

        return $this;
    }
298682
public function dateTime()
	{
		return $this->registry()->isRegistered(self::REGISTRY_DATETIME)
			? $this->lookup(self::REGISTRY_DATETIME)
			: new \DateTime('now')
			;
	}
755681
def this_month(today: datetime=None, tz=None):
    
    if today is None:
        today = datetime.utcnow()
    begin = datetime(day=1, month=today.month, year=today.year)
    end = begin + timedelta(days=32)
    end = datetime(day=1, month=end.month, year=end.year)
    return localize_time_range(begin, end, tz)
1218207
private function order()
    {
        if ($this->startDate > $this->endDate) {
            $tmp = clone $this->startDate;
            $this->startDate = clone $this->endDate;
            $this->endDate = clone $tmp;
            unset($tmp);
        }

        return $this;
    }
241993
public static function now()
    {
        $date = new DateTime();
        if (self::$freeze) {
            $date->setTimestamp(self::$freezeDate->getTimestamp());
            $date->setTimezone(self::$freezeDate->getTimezone());
        }
        return new Clock($date);
    }
1241723
def last_midnight():
    
    now = datetime.now()
    return datetime(now.year, now.month, now.day)
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')));
    }
327625
public static function thisMonth($timeZone = null)
    {
        $now = null;
        $before = null;
        if ( is_null($timeZone) ) {
            $now = new \DateTime();
            $before = new \DateTime();
        } else {
            $now = new \DateTime( "now", new \DateTimeZone( $timeZone ) );
            $before = new \DateTime( "now", new \DateTimeZone( $timeZone ) );
        }
        $dayOfMonth = $now->format( "j" );
        $offset = $dayOfMonth - 1;
        $before->modify( "-$offset day" );
        $range = new Range( $before, $now );

        return $range;
    }