Checks if the passed in date is the same day
        as the instance current day.

        :type dt: DateTime or datetime or str or int

        :rtype: bool
11920
def is_same_day(self, dt):
        
        dt = pendulum.instance(dt)

        return self.to_date_string() == dt.to_date_string()
290349
def current_time(self, date):
        
        ret = self.command(
            'global.cgi?action=setCurrentTime&time={0}'.format(date)
        )

        if "ok" in ret.content.decode('utf-8').lower():
            return True

        return False
429144
def assert_daily(var):
    """

    t0, t1 = var.time[:2]

    # This won't work for non-standard calendars. Needs to be implemented in xarray. Comment for now
    if isinstance(t0.values, np.datetime64):
        if pd.infer_freq(var.time.to_pandas()) != 'D':
            raise ValueError("time series is not recognized as daily.")

    # Check that the first time step is one day.
    if np.timedelta64(dt.timedelta(days=1)) != (t1 - t0).data:
        raise ValueError("time series is not daily.")

    # Check that the series has the same time step throughout
    if not var.time.to_pandas().is_monotonic_increasing:
        raise ValueError("time index is not monotonically increasing.")
1230619
public static boolean sameDay(Date dateOne, Date dateTwo) {
        if ((dateOne == null) || (dateTwo == null)) {
            return false;
        }

        Calendar cal = Calendar.getInstance();
        cal.setTime(dateOne);
        int year = cal.get(Calendar.YEAR);
        int day = cal.get(Calendar.DAY_OF_YEAR);

        cal.setTime(dateTwo);
        int year2 = cal.get(Calendar.YEAR);
        int day2 = cal.get(Calendar.DAY_OF_YEAR);

        return ( (year == year2) && (day == day2) );
    }
894622
def what(self):
        
        originalFromDt = dt.datetime.combine(self.except_date,
                                             timeFrom(self.overrides.time_from))
        changedFromDt = dt.datetime.combine(self.date, timeFrom(self.time_from))
        originalDaysDelta = dt.timedelta(days=self.overrides.num_days - 1)
        originalToDt = getAwareDatetime(self.except_date + originalDaysDelta,
                                        self.overrides.time_to, self.tz)
        changedDaysDelta = dt.timedelta(days=self.num_days - 1)
        changedToDt = getAwareDatetime(self.except_date + changedDaysDelta,
                                        self.time_to, self.tz)
        if originalFromDt < changedFromDt:
            return _("Postponed")
        elif originalFromDt > changedFromDt or originalToDt != changedToDt:
            return _("Rescheduled")
        else:
            return None
531319
def date_from_number(self, value):
        
        if not isinstance(value, numbers.Real):
            return None
        delta = datetime.timedelta(days=value)
        return self._null_date + delta
1364706
def dt2ts(dt, drop_micro=False):
    '''  '''
    is_true(HAS_DATEUTIL, "`pip install python_dateutil` required")
    if is_empty(dt, except_=False):
        ts = None
    elif isinstance(dt, (int, long, float)):  # its a ts already
        ts = float(dt)
    elif isinstance(dt, basestring):  # convert to datetime first
        try:
            parsed_dt = float(dt)
        except (TypeError, ValueError):
            parsed_dt = dt_parse(dt)
        ts = dt2ts(parsed_dt)
    else:
        assert isinstance(dt, (datetime, date))
        # keep micros; see: http://stackoverflow.com/questions/7031031
        ts = ((
            timegm(dt.timetuple()) * 1000.0) +
            (dt.microsecond / 1000.0)) / 1000.0
    if ts is None:
        pass
    elif drop_micro:
        ts = float(int(ts))
    else:
        ts = float(ts)
    return ts
977764
function dateEqual(a, b) {
  if ('date' !== type(b)) return false;
  return sameValue(a.getTime(), b.getTime());
}
612386
def dst(self, dt):
        
        if not self._is_dst(dt):
            return datetime.timedelta(0)

        offset = time.timezone - time.altzone
        return datetime.timedelta(seconds=-offset)
1033079
def is_np_datetime_like(dtype: Union[str, np.dtype]) -> bool:
    
    return (np.issubdtype(dtype, np.datetime64) or
            np.issubdtype(dtype, np.timedelta64))
498646
def yesterday(self) -> datetime:
        
        self.value = datetime.today() - timedelta(days=1)
        return self.value
624580
public static boolean isToday(Date time) {
        String now = getFormatDate(SHORT);
        String target = getFormatDate(SHORT, time);
        return now.equals(target);
    }
548076
def start_of_day(self) -> datetime:
        
        self.value = datetime(self.value.year, self.value.month, self.value.day)
        return self.value
15954
def d_day(self, time):
        ''' 
        '''
        if type(time) == type(TWTime().now):
            self.twtime = TWTime().now
        elif type(time) == type(TWTime().date):
            self.twtime = TWTime().date
        else:
            pass
        return self.caldata(time)
473587
def is_birthday(self, dt=None):
        
        if dt is None:
            dt = self.now(self.tz)

        instance = pendulum.instance(dt)

        return (self.month, self.day) == (instance.month, instance.day)
636187
def yesterday(date=None):
    """"""
    if not date:
        return _date - datetime.timedelta(days=1)
    else:
        current_date = parse(date)
        return current_date - datetime.timedelta(days=1)
697911
def isworkday(self, date):
        
        date = parsefun(date)
        return self.weekdaymap[date.weekday()].isworkday