change 20150812161819 to 2015-08-12 16:18
973255
public static String prettyDateTime(String time) {
        if (time.length() < 12) return time;
        StringBuilder sb = new StringBuilder();
        sb.append(time.substring(0, 4)).append("-").append(time.substring(4, 6)).append("-").append(time.substring(6, 8));
        sb.append(" ").append(time.substring(8, 10)).append(":").append(time.substring(10, 12));
        return sb.toString();
    }
688241
public void modifyTimeBase(){
		String [] time_grid=new String[6];
		time_grid=normalizer.getTimeBase().split("-");
		
		String s = "";
		if(_tp.tunit[0] != -1)
			s += Integer.toString(_tp.tunit[0]);
		else
			s += time_grid[0];
		for(int i = 1; i < 6; i++){
			s += "-";
			if(_tp.tunit[i] != -1)
				s += Integer.toString(_tp.tunit[i]);
			else
				s += time_grid[i];
		}
		normalizer.setTimeBase(s);
	}
383288
function applyDateChange() {
    $timeout.flush();
    $material.flushOutstandingAnimations();

    // Internally, the calendar sets scrollTop to scroll to the month for a change.
    // The handler for that scroll won't be invoked unless we manually trigger it.
    var activeViewController = calendarMonthController || calendarYearController;
    if (activeViewController) {
      angular.element(activeViewController.calendarScroller).triggerHandler('scroll');
    }

    // Need this to handle the nextTick when setting first scroll.
    $timeout.flush();
  }
71701
def modify_such_that_is_before(time2)
      fail 'ZTime#modify_such_that_is_before says: trying to modify time that has @firm set' if @firm
      fail 'ZTime#modify_such_that_is_before says: time2 does not have @firm set' unless time2.firm
      # self cannot have @firm set, so all hours will be between 1 and 12
      # time2 is an end time, self could be its current setting, or off by 12 hours

      # self to time2 --> self to time2
      # 12   to 2am   --> 1200 to 0200
      # 12   to 12am  --> 1200 to 0000
      # 1220 to 12am  --> 1220 to 0000
      # 11 to 2am  or 1100 to 0200
      if self > time2
        if hour == 12 && time2.hour == 0
          # do nothing
        else
          hour == 12 ? change_hour_to(0) : change_hour_to(hour + 12)
        end
      elsif self < time2
        if time2.hour >= 12 && ZTime.new(ZTime.format_time(time2.hour - 12, time2.min_str, time2.sec_str)) > self
          # 4 to 5pm  or 0400 to 1700
          change_hour_to(hour + 12)
        else
          # 4 to 1pm  or 0400 to 1300
          # do nothing
        end
      else
        # the times are equal, and self can only be between 0100 and 1200, so move self forward 12 hours, unless hour is 12
        hour == 12 ? change_hour_to(0) : change_hour_to(hour + 12)
      end
      self.firm = true
      self
    end
146188
function adjustDayOfMonth(self) {
        var fields = self.fields;
        var year = fields[YEAR];
        var month = fields[MONTH];
        var monthLen = getMonthLength(year, month);
        var dayOfMonth = fields[DAY_OF_MONTH];
        if (dayOfMonth > monthLen) {
            self.set(DAY_OF_MONTH, monthLen);
        }
    }
31577
private String update() {
		// If this has been done before, there is no change in checkSum and the last time notified is within GracePeriod
		if(checksum!=0 && checksum()==checksum && now < last.getTime()+graceEnds && now > last.getTime()+lastdays) {
			return null;
		} else {
			return "UPDATE authz.notify SET last = '" +
					Chrono.dateOnlyStamp(last) +
					"', checksum=" +
					current +
					" WHERE user='" +
					user + 
					"' AND type=" +
					type.getValue() +
					";";
		}
	}
667062
static Replacement handleNonDaylightSavingsZone(
      boolean inJodaTimeContext, String daylightSavingsZone, String fixedOffset) {
    if (inJodaTimeContext) {
      String newDescription =
          SUMMARY
              + "\n\n"
              + observesDaylightSavingsMessage("DateTimeZone", daylightSavingsZone, fixedOffset);
      return new Replacement(newDescription, ImmutableList.of(daylightSavingsZone, fixedOffset));
    } else {
      String newDescription =
          SUMMARY
              + "\n\n"
              + "This TimeZone will not observe daylight savings. "
              + "If this is intended, use "
              + fixedOffset
              + " instead; to observe daylight savings, use "
              + daylightSavingsZone
              + ".";
      return new Replacement(newDescription, ImmutableList.of(fixedOffset, daylightSavingsZone));
    }
  }
16621
public function setCurrentTime(): self
	{
		return $this->modifyClone()->setTime((int) date('H'), (int) date('i'), (int) date('s'));
	}
1167720
def change_t(self, t):
        '''
        
        '''
        t = super().change_t(t)
        self.__now_cycles += 1
        if self.__now_cycles % self.__reannealing_per == 0:
            t = t * self.__thermostat
            
            if t < self.__t_min:
                t = self.__t_default
        return t
299941
function prettyDate(time){
  'use strict';


  // Remy Sharp edit: July 13, 2014 specific to JS Bin
  // Need to replace Z in ISO8601 timestamp with +0000 so prettyDate() doesn't
  // completely remove it (and parse the date using the local timezone).
  var date = new Date((time || '').replace('Z', '+0000').replace(/-/g,'/').replace(/[TZ]/g,' ')),
    diff = (((new Date()).getTime() - date.getTime()) / 1000),
    dayDiff = Math.floor(diff / 86400);

  if ( isNaN(dayDiff) || dayDiff < 0 ) {
    return;
  }

  return dayDiff === 0 && (
      diff < 60 && 'just now' ||
      diff < 120 && '1 minute ago' ||
      diff < 3600 && Math.floor( diff / 60 ) + ' minutes ago' ||
      diff < 7200 && '1 hour ago' ||
      diff < 86400 && Math.floor( diff / 3600 ) + ' hours ago') ||
      shortDate(date.getTime());
}
1223017
public void modifyTimeBase() {
        String[] time_grid = new String[6];
        time_grid = timeBaseText.split("-");

        String s = "";
        if (_tp.tunit[0] != -1) {
            s += Integer.toString(_tp.tunit[0]);
        } else {
            s += time_grid[0];
        }
        for (int i = 1; i < 6; i++) {
            s += "-";
            if (_tp.tunit[i] != -1) {
                s += Integer.toString(_tp.tunit[i]);
            } else {
                s += time_grid[i];
            }
        }
        timeBaseText = s;
    }
772392
@Override public void updateTime(final ZonedDateTime TIME) {
        if (dateText.isVisible()) {
            dateText.setText(dateTextFormatter.format(TIME));
            Helper.adjustTextSize(dateText, 0.6 * size, size * 0.08);
            dateText.relocate((size - dateText.getLayoutBounds().getWidth()) * 0.5, size * 0.22180451);
        }
        if (dateNumbers.isVisible()) {
            dateNumbers.setText(dateNumberFormatter.format(TIME));
            Helper.adjustTextSize(dateNumbers, 0.6 * size, size * 0.08);
            dateNumbers.relocate((size -dateNumbers.getLayoutBounds().getWidth()) * 0.5, size * 0.68984962);
        }

        hour.setText(HOUR_FORMATTER.format(TIME));
        Helper.adjustTextSize(hour, 0.4 * size, 0.328 * size);
        hour.relocate(0.136 * size, (size - hour.getLayoutBounds().getHeight()) * 0.5);

        minute.setText(MINUTE_FORMATTER.format(TIME));
        Helper.adjustTextSize(minute, 0.4 * size, 0.328 * size);
        minute.relocate(0.544 * size, (size - minute.getLayoutBounds().getHeight()) * 0.5);

        if (secondBackgroundCircle.isVisible()) {
            secondArc.setLength((-6 * TIME.getSecond()));
            if (clock.isDiscreteSeconds()) {
                secondArc.setLength((-6 * TIME.getSecond()));
            } else {
                secondArc.setLength((-6 * TIME.getSecond() -TIME.get(ChronoField.MILLI_OF_SECOND) * 0.006));
            }
        }
    }
775233
def _fix_review_dates(self, item):
        """"""

        for date_field in ['timestamp', 'createdOn', 'lastUpdated']:
            if date_field in item.keys():
                date_ts = item[date_field]
                item[date_field] = unixtime_to_datetime(date_ts).isoformat()

        if 'patchSets' in item.keys():
            for patch in item['patchSets']:
                pdate_ts = patch['createdOn']
                patch['createdOn'] = unixtime_to_datetime(pdate_ts).isoformat()

                if 'approvals' in patch:
                    for approval in patch['approvals']:
                        adate_ts = approval['grantedOn']
                        approval['grantedOn'] = unixtime_to_datetime(adate_ts).isoformat()

        if 'comments' in item.keys():
            for comment in item['comments']:
                cdate_ts = comment['timestamp']
                comment['timestamp'] = unixtime_to_datetime(cdate_ts).isoformat()
1003036
function datenum(v, date1904) {
        // console.log(v)
        if (date1904) v += 1462;
        let epoch = Date.parse(v);
        return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
    }
283478
def last_modified_date(filename):
    """"""
    mtime = os.path.getmtime(filename)
    dt = datetime.datetime.utcfromtimestamp(mtime)
    return dt.replace(tzinfo=pytz.utc)
977587
def utcoffset(self):
        

        if self.tzinfo is None:
            return None
        return self.tzinfo.utcoffset(self.replace(year=2000))
877923
def modified_on(self):
    """"""
    timestamp = self._info.get('lastModifiedTime')
    return _parser.Parser.parse_timestamp(timestamp)