If the source modified date changes at all, treat it as a modification.
This protects against the case where multiple computers have
misaligned dates and a '<' comparison may fail.
322559
@Override
  public boolean isModified()
  {
    if (_isDigestModified) {
      if (log.isLoggable(Level.FINE))
        log.fine(_source.getNativePath() + " digest is modified.");

      return true;
    }

    long sourceLastModified = _source.getLastModified();
    long sourceLength = _source.length();
    
    // if the source was deleted and we need the source
    if (! _requireSource && sourceLastModified == 0) {
      return false;
    }
    // if the length changed
    else if (sourceLength != _length) {
      if (log.isLoggable(Level.FINE)) {
        log.fine(_source.getNativePath() + " length is modified (" +
                 _length + " -> " + sourceLength + ")");
      }

      return true;
    }
    // if the source is newer than the old value
    else if (sourceLastModified != _lastModified) {
      if (log.isLoggable(Level.FINE))
        log.fine(_source.getNativePath() + " time is modified.");
      
      return true;
    }
    else
      return false;
  }
1133053
function postCompareFunc(a, b) {
  var sortType = option.get('sorttype');
  var diff = new Date(a.meta.pubdate) - new Date(b.meta.pubdate);
  return sortType === 'asc' ? diff : -diff;
}
467686
def _overwrite_special_dates(midnight_utcs,
                             opens_or_closes,
                             special_opens_or_closes):
    
    # Short circuit when nothing to apply.
    if not len(special_opens_or_closes):
        return

    len_m, len_oc = len(midnight_utcs), len(opens_or_closes)
    if len_m != len_oc:
        raise ValueError(
            "Found misaligned dates while building calendar.\n"
            "Expected midnight_utcs to be the same length as open_or_closes,\n"
            "but len(midnight_utcs)=%d, len(open_or_closes)=%d" % len_m, len_oc
        )

    # Find the array indices corresponding to each special date.
    indexer = midnight_utcs.get_indexer(special_opens_or_closes.index)

    # -1 indicates that no corresponding entry was found.  If any -1s are
    # present, then we have special dates that doesn't correspond to any
    # trading day.
    if -1 in indexer:
        bad_dates = list(special_opens_or_closes[indexer == -1])
        raise ValueError("Special dates %s are not trading days." % bad_dates)

    # NOTE: This is a slightly dirty hack.  We're in-place overwriting the
    # internal data of an Index, which is conceptually immutable.  Since we're
    # maintaining sorting, this should be ok, but this is a good place to
    # sanity check if things start going haywire with calendar computations.
    opens_or_closes.values[indexer] = special_opens_or_closes.values
505502
static public Date adjustDate(Date date)
  {
    long milliToAdjust = ResultUtil.msDiffJulianToGregorian(date);

    if (milliToAdjust != 0)
    {
      // add the difference to the new date
      return new Date(date.getTime() + milliToAdjust);
    }
    else
    {
      return date;
    }
  }
1061640
def get_modified_date(parsed, raw):
	''
	if parsed: return feedparser_ts(parsed)
	if not raw: return None

	# Parse weird timestamps that feedparser can't handle, e.g.: July 30, 2013
	ts, val = None, raw.replace('_', ' ')
	if not ts:
		# coreutils' "date" parses virtually everything, but is more expensive to use
		from subprocess import Popen, PIPE
		with open(os.devnull, 'w') as devnull:
			proc = Popen(['date', '+%s', '-d', val], stdout=PIPE, stderr=devnull)
			val = proc.stdout.read()
			if not proc.wait():
				ts = datetime.fromtimestamp(int(val.strip()), tz=timezone.utc)
	if ts: return ts
	raise ValueError('Unrecognized raw value format: {0!r}'.format(val))
338674
public static boolean handleIfUnmodifiedSince(final HttpServerExchange exchange, final Date lastModified) {
        return handleIfUnmodifiedSince(exchange.getRequestHeaders().getFirst(Headers.IF_UNMODIFIED_SINCE), lastModified);
    }
466034
@UiHandler("m_dateModifiedEndDateBox")
    protected void onDateModifiedEndChange(ValueChangeEvent<Date> event) {

        if (event.getValue() != null) {
            m_tabHandler.setDateModifiedEnd(event.getValue().getTime());
        } else {
            // if the field is empty take the max value
            m_tabHandler.setDateModifiedEnd(-1L);
        }
    }
411399
def set_modification_time(self, modification_time=True):
        
        if (isinstance(modification_time, basestring) and
                modification_time.lower() == 'write') or\
                modification_time is True:
            self.modification_time = True
        else:
            self.modification_time = check_time(modification_time)
456853
def _dates(self, key, value):
    
    if value.get('q'):
        self['date_proposed'] = normalize_date(value['q'])
    if value.get('r'):
        self['date_approved'] = normalize_date(value['r'])
    if value.get('s'):
        self['date_started'] = normalize_date(value['s'])
    if value.get('c'):
        self['date_cancelled'] = normalize_date(value['c'])
    if value.get('t'):
        self['date_completed'] = normalize_date(value['t'])

    raise IgnoreKey
205096
public Date adjustDate(final Date startDate, final int increment, final NonWorkingDayChecker<Date> checker) {
        final Calendar cal = Utils.getCal(startDate);

        while (checker.isNonWorkingDay(cal.getTime())) {
            if (increment < 0) {
                cal.add(Calendar.DAY_OF_MONTH, -1);
            } else {
                cal.add(Calendar.DAY_OF_MONTH, 1);
            }
        }

        return cal.getTime();
    }
325815
private boolean hasFileChangedUnexpectedly() {
        synchronized (this) {
            if (mDiskWritesInFlight > 0) {
                // If we know we caused it, it's not unexpected.
                if (DEBUG) System.out.println( "disk write in flight, not unexpected.");
                return false;
            }
        }
        if (!mFile.canRead()) {
            return true;
        }
        synchronized (this) {
            return mStatTimestamp != mFile.lastModified() || mStatSize != mFile.length();
        }
    }
463788
private boolean isNotModified(HttpRequest request, long lastModified) throws ParseException {
    String ifModifiedSince = request.headers().get(HttpHeaderNames.IF_MODIFIED_SINCE);
    if (ifModifiedSince != null && !ifModifiedSince.equals("")) {
      SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
      Date ifModifiedSinceDate = dateFormatter.parse(ifModifiedSince);

      // Only compare up to the second because the datetime format we send to the client does
      // not have milliseconds
      long ifModifiedSinceDateSeconds = ifModifiedSinceDate.getTime() / 1000;
      long fileLastModifiedSeconds = lastModified / 1000;
      return ifModifiedSinceDateSeconds == fileLastModifiedSeconds;
    }
    return false;
  }
670667
public LocalDate getAdjustedDate(LocalDate baseDate, String dateOffsetCode, DateRollConvention dateRollConvention) {
		return getAdjustedDate(createDateFromDateAndOffsetCode(baseDate, dateOffsetCode), dateRollConvention);
	}
649627
private boolean modifyTime(long milliseconds, TimeModification mod) throws LockingException {
                Validate.notNegative(milliseconds);
                Validate.notNull(mod);
                if (milliseconds == 0) {
                        return false;
                }

                long diff = milliseconds;
                if (mod == TimeModification.SUB) {
                        diff = (long) Math.copySign(diff, -1);
                }

                Calendar cal = Calendar.getInstance();
                cal.setTimeInMillis(timestamp.getTime() + diff);
                return setTimestamp(cal.getTime());
        }
622680
def modified(self):
        
        if self._removes:
            return True
        for v in self._value:
            if self._value[v].modified:
                return True
        for v in self._updates:
            if self._updates[v].modified:
                return True
        return False
317184
public Date modifyObject(Context context,
                             String pid,
                             String state,
                             String label,
                             String ownerId,
                             String logMessage,
                             Date lastModifiedDate) throws ServerException {
        return worker.modifyObject(context,
                                   pid,
                                   state,
                                   label,
                                   ownerId,
                                   logMessage,
                                   lastModifiedDate);
    }
446063
public Date modifyDatastreamByValue(Context context,
                                        String pid,
                                        String datastreamID,
                                        String[] altIDs,
                                        String dsLabel,
                                        String mimeType,
                                        String formatURI,
                                        InputStream dsContent,
                                        String checksumType,
                                        String checksum,
                                        String logMessage,
                                        Date lastModifiedDate) throws ServerException {
        throw rejectCallsFromOutsideWhileInRecoveryMode();
    }