Android Milliseconds to Hour Convert getHour(long dateTimeMillis)

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

Description

get Hour

License

Open Source License

Declaration

public static int getHour(long dateTimeMillis) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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());
    }//from   w w w .  j  a  v a2  s.c o m
}

Related

  1. getHoursAndMinutes(long dateTimeMillis)