Return True if created today.
485173
def created_today(self):
        """"""
        if self.datetime.date() == datetime.today().date():
            return True
        return False
624580
public static boolean isToday(Date time) {
        String now = getFormatDate(SHORT);
        String target = getFormatDate(SHORT, time);
        return now.equals(target);
    }
1224263
def check(self):
        
        keywords = "today yesterday this last week month quarter year".split()
        for argument in self.arg:
            if argument not in keywords:
                raise did.base.OptionError(
                    "Invalid argument: '{0}'".format(argument))
985415
def isBirthday(self):
        
        if not self.birthday:
            return False
        birthday = self.birthdate()
        today = date.today()
        return (birthday.month == today.month and
                birthday.day == today.day)
518433
def trigger_created(self, filepath):
        """"""
        if os.path.exists(filepath):
            self._trigger('created', filepath)
982851
def verify_weekday(self, now):
        ''''''
        return self.weekdays == "*" or str(now.weekday()) in self.weekdays.split(" ")
1223847
def creation_date(self):
        
        timestamp = self._prof.get("timecreated")
        if timestamp:
            return time.localtime(timestamp)
776071
public function all_day() {
    if (!$this->values) {
      return false;
    }
    if (($this->start->format('H:i:s') == '00:00:00' && (!$this->end || ($this->end && $this->end->format('H:i:s') == '00:00:00')))) {
      return true;
    }
    return false;
  }
520941
public static boolean isSameDay(Calendar dayOne, Calendar dayTwo) {
        return dayOne.get(Calendar.YEAR) == dayTwo.get(Calendar.YEAR) && dayOne.get(Calendar.DAY_OF_YEAR) == dayTwo.get(Calendar.DAY_OF_YEAR);
    }
558456
public boolean isToday() {
		Validate.notNull(getValue(), getClass().getSimpleName() + " contains null value");
		return DateUtils.isSameDay(new Date(), getValue());
	}
1161258
public function isAllDay()
    {
        if ($this->AllDay) {
            return true;
        }

        $secsInDay = 60 * 60 * 24;
        $startTime = strtotime($this->StartDateTime);
        $endTime = strtotime($this->EndDateTime);

        if (($endTime - $startTime) > $secsInDay) {
            return true;
        }
    }
143962
def check_user(self, todays_facts):
        """"""
        interval = self.conf_notify_interval
        if interval <= 0 or interval >= 121:
            return

        now = dt.datetime.now()
        message = None

        last_activity = todays_facts[-1] if todays_facts else None

        # update duration of current task
        if last_activity and not last_activity['end_time']:
            delta = now - last_activity['start_time']
            duration = delta.seconds /  60

            if duration and duration % interval == 0:
                message = _("Working on %s") % last_activity['name']
                self.notify_user(message)

        elif self.conf_notify_on_idle:
            #if we have no last activity, let's just calculate duration from 00:00
            if (now.minute + now.hour * 60) % interval == 0:
                self.notify_user(_("No activity"))
1042626
def should_run_now(self, force=False):
        from django_cron.models import CronJobLog
        cron_job = self.cron_job
        

        self.user_time = None
        self.previously_ran_successful_cron = None

        # If we pass --force options, we force cron run
        if force:
            return True
        if cron_job.schedule.run_every_mins is not None:

            # We check last job - success or not
            last_job = None
            try:
                last_job = CronJobLog.objects.filter(code=cron_job.code).latest('start_time')
            except CronJobLog.DoesNotExist:
                pass
            if last_job:
                if not last_job.is_success and cron_job.schedule.retry_after_failure_mins:
                    if get_current_time() > last_job.start_time + timedelta(minutes=cron_job.schedule.retry_after_failure_mins):
                        return True
                    else:
                        return False

            try:
                self.previously_ran_successful_cron = CronJobLog.objects.filter(
                    code=cron_job.code,
                    is_success=True,
                    ran_at_time__isnull=True
                ).latest('start_time')
            except CronJobLog.DoesNotExist:
                pass

            if self.previously_ran_successful_cron:
                if get_current_time() > self.previously_ran_successful_cron.start_time + timedelta(minutes=cron_job.schedule.run_every_mins):
                    return True
            else:
                return True

        if cron_job.schedule.run_at_times:
            for time_data in cron_job.schedule.run_at_times:
                user_time = time.strptime(time_data, "%H:%M")
                now = get_current_time()
                actual_time = time.strptime("%s:%s" % (now.hour, now.minute), "%H:%M")
                if actual_time >= user_time:
                    qset = CronJobLog.objects.filter(
                        code=cron_job.code,
                        ran_at_time=time_data,
                        is_success=True
                    ).filter(
                        Q(start_time__gt=now) | Q(end_time__gte=now.replace(hour=0, minute=0, second=0, microsecond=0))
                    )
                    if not qset:
                        self.user_time = time_data
                        return True

        return False
95057
public boolean hasNoTime(Statement o) {	 
        if (o instanceof HasTime) return false;
        if (o instanceof Activity) return false;
        return true;
        /* OLD Definition
         return (o instanceof WasDerivedFrom) 
        	 || (o instanceof ActedOnBehalfOf)
                 || (o instanceof WasInformedBy)
                 || (o instanceof WasAttributedTo)
                 || (o instanceof WasAssociatedWith)
                 || (o instanceof WasInfluencedBy)
                 || (o instanceof SpecializationOf)
                 || (o instanceof AlternateOf)
                 || (o instanceof MentionOf)
                 || (o instanceof HadMember);
         */
    }
851690
protected boolean shouldCreateWorkunit(long createTime, long updateTime, LongWatermark lowWatermark) {
    if (new DateTime(updateTime).isBefore(this.maxLookBackTime)) {
      return false;
    }
    return new DateTime(updateTime).isAfter(lowWatermark.getValue());
  }
1149917
private static int isTodayOrTomorrow(Resources r, long dayMillis,
                                         long currentMillis, long localGmtOffset) {
        int startDay = Time.getJulianDay(dayMillis, localGmtOffset);
        int currentDay = Time.getJulianDay(currentMillis, localGmtOffset);

        int days = startDay - currentDay;
        if (days == 1) {
            return TOMORROW;
        } else if (days == 0) {
            return TODAY;
        } else {
            return NONE;
        }
    }
733145
def is_active(self):
        
        start = self.start_date()
        return not self.is_completed() and (not start or start <= date.today())