Lines Matching refs:time

38  * elapsed time and date ranges, strings for days of the week and months, and AM/PM text etc.
95 // Date and time format strings that are constant and don't need to be
245 * Returns a string describing the elapsed time since startTime.
246 * @param startTime some time in the past.
247 * @return a String object containing the elapsed time.
255 * Returns a string describing 'time' as a time relative to 'now'.
260 * @param time the time to describe, in milliseconds
261 * @param now the current time in milliseconds
262 * @param minResolution the minimum timespan to report. For example, a time 3 seconds in the
266 public static CharSequence getRelativeTimeSpanString(long time, long now, long minResolution) {
268 return getRelativeTimeSpanString(time, now, minResolution, flags);
272 * Returns a string describing 'time' as a time relative to 'now'.
280 * @param time the time to describe, in milliseconds
281 * @param now the current time in milliseconds
282 * @param minResolution the minimum timespan to report. For example, a time
291 public static CharSequence getRelativeTimeSpanString(long time, long now, long minResolution,
296 boolean past = (now >= time);
297 long duration = Math.abs(now - time);
347 return getRelativeDayString(r, time, now);
349 // We know that we won't be showing the time, so it is safe to pass
351 return formatDateRange(null, time, time, flags);
359 * Return string describing the elapsed time since startTime formatted like
360 * "[relative time/date], [time]".
370 * @param time some time in the past.
371 * @param minResolution the minimum elapsed time (in milliseconds) to report
372 * when showing relative times. For example, a time 3 seconds in
375 * @param transitionResolution the elapsed time (in milliseconds) at which
381 public static CharSequence getRelativeDateTimeString(Context c, long time, long minResolution,
386 long duration = Math.abs(now - time);
397 CharSequence timeClause = formatDateRange(c, time, time, FORMAT_SHOW_TIME);
401 CharSequence relativeClause = getRelativeTimeSpanString(time, now, minResolution, flags);
404 CharSequence dateClause = getRelativeTimeSpanString(c, time, false);
418 * @param today the current time in UTC milliseconds
478 * minutes" or "1 second". Returns only largest meaningful unit of time,
501 * Formats an elapsed time in the form "MM:SS" or "H:MM:SS"
503 * @param elapsedSeconds the elapsed time in seconds.
510 * Formats an elapsed time in a format like "MM:SS" or "H:MM:SS" (using a form
515 * @param elapsedSeconds the elapsed time in seconds.
541 // Format the broken-down time in a locale-appropriate way.
553 * Format a date / time such that if the then is on the same day as now, it shows
554 * just the time and if it's a different day, it shows just the date.
565 * @param now the base time
567 * @param timeStyle how to format the time portion.
593 Time time = new Time();
594 time.set(when);
596 int thenYear = time.year;
597 int thenMonth = time.month;
598 int thenMonthDay = time.monthDay;
600 time.set(System.currentTimeMillis());
601 return (thenYear == time.year)
602 && (thenMonth == time.month)
603 && (thenMonthDay == time.monthDay);
607 * Formats a date or a time range according to the local conventions.
611 * somewhat costly in terms of memory and time. This is probably acceptable
618 * @param context the context is required only if the time is shown
619 * @param startMillis the start time in UTC milliseconds
620 * @param endMillis the end time in UTC milliseconds
623 * @return a string containing the formatted date/time range.
632 * Formats a date or a time range according to the local conventions.
635 * time range in the local time zone. If you want to specify the time
639 * @param context the context is required only if the time is shown
643 * @param startMillis the start time in UTC milliseconds
644 * @param endMillis the end time in UTC milliseconds
647 * @return a string containing the formatted date/time range.
655 * Formats a date or a time range according to the local conventions.
703 * If FORMAT_SHOW_TIME is set, the time is shown as part of the date range.
704 * If the start and end time are the same, then just the start time is
727 * If FORMAT_CAP_AMPM is set and 12-hour time is used, then the "AM"
733 * If FORMAT_NO_NOON is set and 12-hour time is used, then "12pm" is
737 * If FORMAT_CAP_NOON is set and 12-hour time is used, then "Noon" is
743 * If FORMAT_NO_MIDNIGHT is set and 12-hour time is used, then "12am" is
747 * If FORMAT_CAP_MIDNIGHT is set and 12-hour time is used, then "Midnight"
753 * If FORMAT_12HOUR is set and the time is shown, then the time is
754 * shown in the 12-hour time format. You should not normally set this.
755 * Instead, let the time format be chosen automatically according to the
760 * If FORMAT_24HOUR is set and the time is shown, then the time is
761 * shown in the 24-hour time format. You should not normally set this.
762 * Instead, let the time format be chosen automatically according to the
767 * If FORMAT_UTC is set, then the UTC time zone is used for the start
768 * and end milliseconds unless a time zone is specified. If a time zone
772 * If FORMAT_ABBREV_TIME is set and 12-hour time format is used, then the
774 * if they are zero. For example, instead of "3:00pm" the time would be
800 * <li>When the time is not displayed. This results in "Nov 10 - 11" for
805 * @param context the context is required only if the time is shown
809 * @param startMillis the start time in UTC milliseconds
810 * @param endMillis the end time in UTC milliseconds
812 * @param timeZone the time zone to compute the string in. Use null for local
815 * @return the formatter with the formatted date/time range appended to the string buffer.
819 // If we're being asked to format a time without being explicitly told whether to use
836 * Formats a date or a time according to the local conventions. There are
838 * time is shown, if the day of the week is shown, if the month name is
872 * @param context the context is required only if the time is shown
873 * @param millis a point in time in UTC milliseconds
875 * @return a string containing the formatted date/time.
882 * @return a relative time string to display the time expressed by millis. Times
884 * time is March 31st, 0:30:
942 * Convenience function to return relative time string without preposition.
944 * @param millis time in milliseconds
945 * @return {@link CharSequence} containing relative time.