Android Long to Date Convert getHour(long dateTimeMillis)

Here you can find the source of getHour(long dateTimeMillis)

Description

get Hour

Declaration

public static int getHour(long dateTimeMillis) 

Method Source Code

//package com.java2s;
import java.text.SimpleDateFormat;

public class Main {
    public static int getHour(long dateTimeMillis) {
        SimpleDateFormat format = new SimpleDateFormat("HH");
        StringBuilder dateString = new StringBuilder(
                format.format(dateTimeMillis));
        return Integer.parseInt(dateString.toString());
    }// ww  w  .j a  v a  2 s .c o m
}

Related

  1. getDefaultDateTimeString(long date, Locale locale)
  2. getDefaultDatetime(long milliseconds)
  3. getElapsedDurationSince(long seconds)
  4. getFormattedTime(String dateTimeFormat, long timestamp)
  5. getFriendlyDate(Context context, long timestamp)
  6. getHour(long timeMillis)
  7. getHoursAndMinutes(long dateTimeMillis)
  8. getLocalTimeFromUTCMillis(long utcMillis)
  9. getLongOfString(String date)