Tabnine Logo
SunshineDateUtils.normalizeDate
Code IndexAdd Tabnine to your IDE (free)

How to use
normalizeDate
method
in
com.example.android.sunshine.utilities.SunshineDateUtils

Best Java code snippets using com.example.android.sunshine.utilities.SunshineDateUtils.normalizeDate (Showing top 20 results out of 846)

origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
origin: udacity/ud851-Sunshine

  /**
   * Returns just the selection part of the weather query from a normalized today value.
   * This is used to get a weather forecast from today's date. To make this easy to use
   * in compound selection, we embed today's date as an argument in the query.
   *
   * @return The selection part of the weather query for today onwards
   */
  public static String getSqlSelectForTodayOnwards() {
    long normalizedUtcNow = SunshineDateUtils.normalizeDate(System.currentTimeMillis());
    return WeatherContract.WeatherEntry.COLUMN_DATE + " >= " + normalizedUtcNow;
  }
}
com.example.android.sunshine.utilitiesSunshineDateUtilsnormalizeDate

Javadoc

Normalizes a date (in milliseconds). Normalize, in our usage within Sunshine means to convert a given date in milliseconds to the very beginning of the date in UTC time. For example, given the time representing Friday, 9/16/2016, 17:45:15 GMT-4:00 DST (1474062315000) this method would return the number of milliseconds (since the epoch) that represents Friday, 9/16/2016, 00:00:00 GMT (1473984000000) To make it easy to query for the exact date, we normalize all dates that go into the database to the start of the day in UTC time. In order to normalize the date, we take advantage of simple integer division, noting that any remainder is discarded when dividing two integers. For example, dividing 7 / 3 (when using integer division) equals 2, not 2.333 repeating as you may expect.

Popular methods of SunshineDateUtils

  • getDayName
    Given a day, returns just the name to use for that day. E.g "today", "tomorrow", "Wednesday".
  • getFriendlyDateString
    Helper method to convert the database representation of the date into something to display to users.
  • getReadableDateString
    Returns a date string in the format specified, which shows an abbreviated date without a year.
  • elapsedDaysSinceEpoch
    This method returns the number of days since the epoch (January 01, 1970, 12:00 Midnight UTC) in UTC
  • getLocalMidnightFromNormalizedUtcDate
    This method will return the local time midnight for the provided normalized UTC date.
  • getNormalizedUtcDateForToday
    This method returns the number of milliseconds (UTC time) for today's date at midnight in the local
  • getDayNumber
    This method returns the number of days since the epoch (January 01, 1970, 12:00 Midnight UTC) in UTC
  • getLocalDateFromUTC
    Since all dates from the database are in UTC, we must convert the given date (in UTC timezone) to th
  • getUTCDateFromLocal
    Since all dates from the database are in UTC, we must convert the local date to the date in UTC time
  • isDateNormalized
    In order to ensure consistent inserts into WeatherProvider, we check that dates have been normalized

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now