Creates a label of the form "9:15am". TODO: support 24 hour time for people who go for that
sort of thing. If date is null the empty string is returned.
3991
public static String formatTime (Date date)
    {
        return (date == null) ? "" : _tfmt.format(date).toLowerCase();
    }
474692
public static int getHour(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.HOUR_OF_DAY);
    }
133995
public String createDateString(Date date) {
        if (date == null) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "Null Date object provided; returning null");
            }
            return null;
        }
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "Creating date string based on date: " + date);
        }
        String formatted = simpleDateFormat.format(date);
        return formatted;
    }
536100
public static int getHour(Date timeFrom) {
		Calendar instance = Calendar.getInstance();
		instance.setTime(timeFrom);
		int hour = instance.get(Calendar.HOUR);
		return hour;

	}
472225
Rule TimeSignature() {
		return FirstOf(
				String("C|"),
				String("C"),
				IgnoreCase("none"),
				MeterNum(),
				DIGIT()
		).label(TimeSignature);
	}
1135909
public static TransactionException invalidLabelStart(Label label) {
        return create(String.format("Cannot create a label {%s} starting with character {%s} as it is a reserved starting character", label, Schema.ImplicitType.RESERVED.getValue()));
    }
998648
public String formatDate(Date d) {
        if (d == null) return null;
        JsDate jsd = JsDate.create(d.getTime());
        return internFormat(input.getElement(), getActiveDateFormat(), jsd);
    }
314943
function formatDatetime(date) {
  date = new Date(date);
  var hour = date.getHours();
  var minutes =
    date.getMinutes() < 10
      ? '0' + date.getMinutes().toString()
      : date.getMinutes();

  return formatDate(date) + ' ' + hour + ':' + minutes;
}
371472
protected String createSendTime(final Date sendTime) {
    if (sendTime == null || new Date(System.currentTimeMillis() + 1000L * 60L).after(sendTime)) {
      return null;
    }
    String customSendTimePattern =
        StringUtils.isBlank(this.sendTimePattern) ? DEFAULT_SEND_TIME_PATTERN
            : this.sendTimePattern;
    SimpleDateFormat sdf = new SimpleDateFormat(customSendTimePattern, Locale.GERMANY);
    sdf.setTimeZone(TimeZone.getTimeZone("Europe/Berlin"));
    return sdf.format(sendTime);
  }
1146526
function drawHourLabels() {
            let hourLabelsGroup = svg.select('.hour-labels-group');

            hourLabels = svg.select('.hour-labels-group').selectAll('.hour-label')
                .data(hoursHuman);

            hourLabels.enter()
              .append('text')
                .text((label) => label)
                .attr('y', 0)
                .attr('x', (d, i) => i * boxSize)
                .style('text-anchor', 'middle')
                .style('dominant-baseline', 'central')
                .attr('class', 'hour-label');

            hourLabelsGroup.attr('transform', `translate(${boxSize / 2}, -${hourLabelHeight})`);
        }
64940
private String getStrTime(Calendar c)
   {
      int h = c.get(Calendar.HOUR);
      int m = c.get(Calendar.MINUTE);
      int s = c.get(Calendar.SECOND);
      return "" + (h < 10 ? "0" + h : h) + (m < 10 ? "0" + m : m) + (s < 10 ? "0" + s : s);
   }
1239920
private String getWeekDayLabel(Calendar day) {
        Locale locale = mController.getLocale();

        // Localised short version of the string is not available on API < 18
        if (Build.VERSION.SDK_INT < 18) {
            String dayName = new SimpleDateFormat("E", locale).format(day.getTime());
            String dayLabel = dayName.toUpperCase(locale).substring(0, 1);

            // Chinese labels should be fetched right to left
            if (locale.equals(Locale.CHINA) || locale.equals(Locale.CHINESE) || locale.equals(Locale.SIMPLIFIED_CHINESE) || locale.equals(Locale.TRADITIONAL_CHINESE)) {
                int len = dayName.length();
                dayLabel = dayName.substring(len - 1, len);
            }

            // Most hebrew labels should select the second to last character
            if (locale.getLanguage().equals("he") || locale.getLanguage().equals("iw")) {
                if (mDayLabelCalendar.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY) {
                    int len = dayName.length();
                    dayLabel = dayName.substring(len - 2, len - 1);
                } else {
                    // I know this is duplication, but it makes the code easier to grok by
                    // having all hebrew code in the same block
                    dayLabel = dayName.toUpperCase(locale).substring(0, 1);
                }
            }

            // Catalan labels should be two digits in lowercase
            if (locale.getLanguage().equals("ca"))
                dayLabel = dayName.toLowerCase().substring(0, 2);

            // Correct single character label in Spanish is X
            if (locale.getLanguage().equals("es") && day.get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY)
                dayLabel = "X";

            return dayLabel;
        }
        // Getting the short label is a one liner on API >= 18
        if (weekDayLabelFormatter == null) {
            weekDayLabelFormatter = new SimpleDateFormat("EEEEE", locale);
        }
        return weekDayLabelFormatter.format(day.getTime());
    }
265518
private void initDatesPanel() {

        m_startLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_TIME_STARTTIME_0));
        m_startTime.setAllowInvalidValue(true);
        m_startTime.setValue(m_model.getStart());
        m_endLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_TIME_ENDTIME_0));
        m_endTime.setAllowInvalidValue(true);
        m_endTime.setValue(m_model.getEnd());
        m_seriesCheckBox.setText(Messages.get().key(Messages.GUI_SERIALDATE_SERIES_CHECKBOX_0));
        m_wholeDayCheckBox.setText(Messages.get().key(Messages.GUI_SERIALDATE_WHOLE_DAY_CHECKBOX_0));
        m_currentTillEndCheckBox.setText(Messages.get().key(Messages.GUI_SERIALDATE_CURRENT_TILL_END_CHECKBOX_0));
        m_currentTillEndCheckBox.getButton().setTitle(
            Messages.get().key(Messages.GUI_SERIALDATE_CURRENT_TILL_END_CHECKBOX_HELP_0));
    }
1027784
private String toLabel(final TimeUnit unit) {
      switch(unit) {
         case DAYS: return "day";
         case HOURS: return "hour";
         case MINUTES: return "minute";
         case SECONDS: return "second";
         case MILLISECONDS: return "ms";
         case MICROSECONDS: return "us";
         case NANOSECONDS: return "ns";
         default: return "";
      }
   }
1037931
def create_time_labels(self):
        
        min_time = int(floor(min(self.data.axis['time'][0])))
        max_time = int(ceil(max(self.data.axis['time'][0])))
        n_time_labels = self.parent.value('n_time_labels')

        self.idx_time = []
        self.time_pos = []
        for one_time in linspace(min_time, max_time, n_time_labels):
            x_label = (self.data.start_time +
                       timedelta(seconds=one_time)).strftime('%H:%M:%S')
            item = QGraphicsSimpleTextItem(x_label)
            item.setFlag(QGraphicsItem.ItemIgnoresTransformations)
            self.idx_time.append(item)
            self.time_pos.append(QPointF(one_time,
                                         len(self.idx_label) *
                                         self.parent.value('y_distance')))
826960
function() {
    var time = null;

    if (this.method === 'from now') {
      time = ago.fromNow(this.amount, this.unit);
    } else if (this.method === 'ago') {
      time = ago(this.amount, this.unit);
    } else {
      throw new Error('Invalid method: ' + this.method);
    }

    return new Date(time);
  }
625706
def timespan_from_string(value)
      timespan = DPLA::MAP::TimeSpan.new
      timespan.providedLabel = value
      timespan
    end