Returns a new date/time representing the end of the month.
 DateTime objects will have a time set to 23:59:59.
351151
def end_of_month
      last_day = ::Time.days_in_month(month, year)
      last_hour(days_since(last_day - day))
    end
927631
def end_date(self) -> Optional[datetime.date]:
        
        if not self.intervals:
            return None
        return self.end_datetime().date()
435571
public function endOfMonth()
    {
        return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay();
    }
1022199
def end_date(self, value):
        

        if not isinstance(value, datetime):
            raise TypeError(_pretty_message(
                '''
                end_date must be an instance of datetime.datetime, not %s
                ''',
                _type_name(value)
            ))

        self._end_date = value
749502
def get_std_end_date(self):
        
        _, second = self._val
        if second != datetime.max:
            return second.strftime("%Y-%m-%d %H:%M:%S")
        else:
            return ""
795893
public static function lastMonthRange()
    {
        $begin = mktime(0, 0, 0, date('m') - 1, 1, date('Y'));
        $end = mktime(23, 59, 59, date('m') - 1, date('t', $begin), date('Y'));

        return [$begin, $end];
    }
1183912
public static long getDayEndTime(final long time) {
        final Calendar end = Calendar.getInstance();
        end.setTimeInMillis(time);
        final int year = end.get(Calendar.YEAR);
        final int month = end.get(Calendar.MONTH);
        final int day = end.get(Calendar.DATE);
        end.set(year, month, day, 23, 59, 59);
        end.set(Calendar.MILLISECOND, 999);

        return end.getTimeInMillis();
    }
546021
def as_dates(self):
        
        new_start = self.start.date() if self.start and isinstance(self.start, datetime.datetime) else self.start
        new_end = self.end.date() if self.end and isinstance(self.end, datetime.datetime) else self.end
        return DateRange(new_start, new_end, CLOSED_CLOSED)
1241723
def last_midnight():
    
    now = datetime.now()
    return datetime(now.year, now.month, now.day)
839288
def get_dataset_end_date_as_datetime(self):
        # type: () -> Optional[datetime]
        
        dataset_date = self.data.get('dataset_date', None)
        if dataset_date:
            if '-' in dataset_date:
                dataset_date = dataset_date.split('-')[1]
                return datetime.strptime(dataset_date, '%m/%d/%Y')
        return None
1217185
def month_interval(year, month, return_str=False):
        
        if month == 12:
            start, end = datetime(year, month, 1), datetime(year+1, 1, 1) - timedelta(seconds=1)
        else:
            start, end = datetime(year, month, 1), datetime(year, month+1, 1) - timedelta(seconds=1)
            
        if not return_str:
            return start, end
        else:
            return str(start), str(end)
941999
public com.google.api.ads.admanager.axis.v201808.DateTime getEndDateTime() {
        return endDateTime;
    }
716565
def _get_end_time(self, start_time: datetime) -> datetime:
        
        if Type.is_type_equal(self._schema.window_type, Type.DAY):
            return start_time + timedelta(days=self._schema.window_value)
        elif Type.is_type_equal(self._schema.window_type, Type.HOUR):
            return start_time + timedelta(hours=self._schema.window_value)
1166792
public static Date getLastDayFromCurrentMonth(Date d) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(d);                
        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
        cal.set(Calendar.HOUR_OF_DAY, 23);
        cal.set(Calendar.MINUTE, 59);
        cal.set(Calendar.SECOND, 59);
        cal.set(Calendar.MILLISECOND, 999);
        return cal.getTime();
    }
1157681
public function endOfMonth(\DateTime $datetime)
	{
		$year = $datetime->format('Y');
		$month = $datetime->format('m');
		$day = $datetime->format('t');

		$datetime->setDate($year, $month, $day);
	}
394255
public com.google.api.ads.admanager.axis.v201808.DateTime getEndTime() {
        return endTime;
    }
1266316
def datetime(
        self, year, month, day, hour=0, minute=0, second=0, microsecond=0
    ):  # type: (int, int, int, int, int, int, int) -> datetime
        
        if _HAS_FOLD:
            return self.convert(
                datetime(year, month, day, hour, minute, second, microsecond, fold=1)
            )

        return self.convert(
            datetime(year, month, day, hour, minute, second, microsecond),
            dst_rule=POST_TRANSITION,
        )