Lines Matching refs:Time
49 import android.text.format.Time;
105 public static final int MONDAY_BEFORE_JULIAN_EPOCH = Time.EPOCH_JULIAN_DAY - 3;
128 // reasons, as it's what PreferenceManager assigned the first time the file
264 * Writes a new home time zone to the db. Updates the home time zone in the
265 * db asynchronously and updates the local cache. Sending a time zone of
266 * **tbd** will cause it to be set to the device's time zone. null or empty
270 * @param timeZone The time zone to set Calendar to, or **tbd**
277 * Gets the time zone that Calendar should be displayed in This is a helper
278 * method to get the appropriate time zone for Calendar. If this is the
279 * first time this method has been called it will initiate an asynchronous
288 * @return The string value representing the time zone Calendar should
296 * Formats a date or a time range according to the local conventions.
298 * @param context the context is required only if the time is shown
299 * @param startMillis the start time in UTC milliseconds
300 * @param endMillis the end time in UTC milliseconds
303 * @return a string containing the formatted date/time range.
410 // At backup manager "restore" time (which should happen before launcher
411 // comes up for the first time), the value will be set/reset to default
419 // the first time and restore hasn't happened. Migrate value from
440 * Save default agenda/day/week/month view for next time
523 * If the given intent specifies a time (in milliseconds since the epoch),
524 * then that time is returned. Otherwise, the current time is returned.
527 // If the time was specified, then use that. Otherwise, use the current
528 // time.
533 if (path.size() == 2 && path.get(0).equals("time")) {
537 Log.i("Calendar", "timeFromIntentInMillis: Data existed but no valid time "
538 + "found. Using current time.");
549 * Formats the given Time object so that it gives the month and year (for
552 * @param time the time to format
555 public static String formatMonthYear(Context context, Time time) {
558 long millis = time.toMillis(true);
585 * Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
589 * week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
594 * see {@link Time#SUNDAY}
598 int diff = Time.THURSDAY - firstDayOfWeek;
602 int refDay = Time.EPOCH_JULIAN_DAY - diff;
610 * This assumes that the week containing the {@link Time#EPOCH_JULIAN_DAY}
622 * Get first day of week as android.text.format.Time constant.
624 * @return the first day of week in android.text.format.Time
639 return Time.SATURDAY;
641 return Time.MONDAY;
643 return Time.SUNDAY;
657 * Converts the day of the week from android.text.format.Time to java.util.Calendar
661 case Time.MONDAY:
663 case Time.TUESDAY:
665 case Time.WEDNESDAY:
667 case Time.THURSDAY:
669 case Time.FRIDAY:
671 case Time.SATURDAY:
673 case Time.SUNDAY:
676 throw new IllegalArgumentException("Argument must be between Time.SUNDAY and " +
677 "Time.SATURDAY");
707 * @param firstDayOfWeek the first day of week in android.text.format.Time
711 return (firstDayOfWeek == Time.SUNDAY && column == 6)
712 || (firstDayOfWeek == Time.MONDAY && column == 5)
713 || (firstDayOfWeek == Time.SATURDAY && column == 0);
720 * @param firstDayOfWeek the first day of week in android.text.format.Time
724 return (firstDayOfWeek == Time.SUNDAY && column == 0)
725 || (firstDayOfWeek == Time.MONDAY && column == 6)
726 || (firstDayOfWeek == Time.SATURDAY && column == 1);
730 * Convert given UTC time into current local time. This assumes it is for an
731 * allday event and will adjust the time to be on a midnight boundary.
733 * @param recycle Time object to recycle, otherwise null.
734 * @param utcTime Time to convert, in UTC.
735 * @param tz The time zone to convert this time to.
737 public static long convertAlldayUtcToLocal(Time recycle, long utcTime, String tz) {
739 recycle = new Time();
741 recycle.timezone = Time.TIMEZONE_UTC;
747 public static long convertAlldayLocalToUTC(Time recycle, long localTime, String tz) {
749 recycle = new Time();
753 recycle.timezone = Time.TIMEZONE_UTC;
760 * @param recycle - Time object to recycle, otherwise null.
761 * @param theTime - Time used for calculations (in UTC)
762 * @param tz The time zone to convert this time to.
764 public static long getNextMidnight(Time recycle, long theTime, String tz) {
766 recycle = new Time();
869 // Now unregister the receiver so that we won't continue to sync every time.
886 // A segment is a single continuous length of time occupied by a single
897 * ordered by start time of the events. The function processes events for a
900 * ordered by start time. This list of segments is then converted into a
917 * @param events A list of events sorted by start time
958 // MIN_SEGMENT_PIXELS in the 'work day' time slot. This computes the
994 // If the end time is before the work day make sure it ends at least
1028 // Now compare our current start time to the end time of the last
1239 // the first day we want the start time to be the actual start time
1253 // The last day we want the end time to be the actual end time
1321 * Given a context and a time in millis since unix epoch figures out the
1322 * correct week of the year for that time.
1328 Time weekTime = new Time(getTimeZone(context, null));
1335 if (weekTime.weekDay == Time.SUNDAY
1336 && (firstDayOfWeek == Time.SUNDAY || firstDayOfWeek == Time.SATURDAY)) {
1339 } else if (weekTime.weekDay == Time.SATURDAY && firstDayOfWeek == Time.SATURDAY) {
1352 * @param millis A utc millis since epoch time that falls on julian day
1378 // Calculate the time until midnight + 1 second and set the handler to
1385 Time time = new Time(timezone);
1386 time.set(now);
1387 long runInMillis = (24 * 3600 - time.hour * 3600 - time.minute * 60 -
1388 time.second + 1) * 1000;
1402 * Returns a string description of the specified time interval.
1406 // Configure date/time formatting.
1413 Time currentTime = new Time(localTimezone);
1436 endMillis, flagsDate, Time.TIMEZONE_UTC).toString();
1440 // Format the time.
1487 Time startTime = new Time(localTimezone);
1496 * Returns whether the specified time interval is in a single day.
1504 // time end-1.
1505 int startDay = Time.getJulianDay(startMillis, localGmtOffset);
1506 int endDay = Time.getJulianDay(endMillis - 1, localGmtOffset);
1520 int startDay = Time.getJulianDay(dayMillis, localGmtOffset);
1521 int currentDay = Time.getJulianDay(currentMillis, localGmtOffset);
1658 Time now = new Time(timezone);