Returns start of day
548076
def start_of_day(self) -> datetime:
        
        self.value = datetime(self.value.year, self.value.month, self.value.day)
        return self.value
1267139
public function startDay()
    {
        $dateString = sprintf('%04d-%02d-01', $this->year->value(), $this->month);

        $datetime = new \DateTime($dateString);

        return (int) $datetime->format('N');
    }
852580
function(d) {
    return d.wm || (d.wm =
      (later.D.val(d) +
      (later.dw.val(later.M.start(d)) - 1) + (7 - later.dw.val(d))) / 7);
  }
1275316
function(start, end) {
    var date;
    var res = [];
    for (var key in holidays) {
      date = beginningOfDay(new Date(key));
      // given `start` and `end` Date object are both normalized to beginning of the day
      if (beginningOfDay(start) <= date && date <= beginningOfDay(end)) {
        res.push(holiday(date, holidays[key]));
      }
    }
    return res;
  }
824919
def snap_to_beginning_of_week(day, weekday_start="Sunday"):
    
    delta_days = ((day.weekday() + 1) % 7) if weekday_start is "Sunday" else day.weekday()
    return day - timedelta(days=delta_days)
485855
def run_etime(self):
        """"""
        if self.start_datetime is None or self.end_datetime is None:
            return None

        return self.end_datetime - self.start_datetime
585711
def start_time(self):
        """"""
        dt = self.nc['time'].dt
        return datetime(year=dt.year, month=dt.month, day=dt.day,
                        hour=dt.hour, minute=dt.minute,
                        second=dt.second, microsecond=dt.microsecond)
527463
def days_to_week_start(start_day = Date.beginning_of_week)
      start_day_number = DAYS_INTO_WEEK.fetch(start_day)
      (wday - start_day_number) % 7
    end
390438
public int getDayDifference(long first, long second) {

        Calendar firstDay = getStartOfDay(first);
        Calendar secondDay = getStartOfDay(second);
        int result = 0;
        if (first >= second) {
            while (firstDay.after(secondDay)) {
                firstDay.add(Calendar.DAY_OF_MONTH, -1);
                result += 1;
            }
        } else {
            while (secondDay.after(firstDay)) {
                secondDay.add(Calendar.DAY_OF_MONTH, -1);
                result -= 1;
            }
        }
        return result;
    }
448033
def set_day(self, day: int) -> datetime:
        
        self.value = self.value.replace(day=day)
        return self.value
1327375
function isDayFirst() {
    if (dayFirst !== null) {
      return dayFirst;
    }

    var formatter = makeFormatter({day: 'numeric', month: 'short'});
    if (formatter) {
      var output = formatter.format(new Date(0));
      dayFirst = !!output.match(/^\d/);
      return dayFirst;
    } else {
      return false;
    }
  }
530110
def date_elem(ind_days, ind_minutes):
    """"""
    def inner(seq):
        return nexrad_to_datetime(seq[ind_days], seq[ind_minutes] * 60 * 1000)
    return inner
922215
def _getAbsoluteTime(self, start, delay):
        
        return start + datetime.timedelta(days=0, seconds=delay)
813525
function dayOffsetToCellOffset(dayOffset) {
		var day0 = t.visStart.getDay(); // first date's day of week
		dayOffset += day0; // normalize dayOffset to beginning-of-week
		return Math.floor(dayOffset / 7) * cellsPerWeek // # of cells from full weeks
			+ dayToCellMap[ // # of cells from partial last week
				(dayOffset % 7 + 7) % 7 // crazy math to handle negative dayOffsets
			]
			- dayToCellMap[day0]; // adjustment for beginning-of-week normalization
	}
470529
def get_day():
    """"""
    day = datetime.datetime.today().weekday()
    if len(sys.argv) == 3:
        if sys.argv[2] == "mon":
            day = 0
        elif sys.argv[2] == "tue":
            day = 1
        elif sys.argv[2] == "wed":
            day = 2
        elif sys.argv[2] == "thur":
            day = 3
        elif sys.argv[2] == "fri":
            day = 4
        else:
            day = 5
    if day > 4:
        print("There is no information about the menu today.")
        exit(5)
    return day
938078
def days(start, stop):
    
    dates=rrule.rruleset()
    # Get dates between start/stop (which are inclusive)
    dates.rrule(rrule.rrule(rrule.DAILY, dtstart=start, until=stop))
    return dates.count()
175563
def start_of_day(val):
    
    if type(val) == date:
        val = datetime.fromordinal(val.toordinal())
    return val.replace(hour=0, minute=0, second=0, microsecond=0)