Android Milliseconds to Month Convert getMonth(long dateTimeMillis)

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

Description

get Month

License

Open Source License

Declaration

public static int getMonth(long dateTimeMillis) 

Method Source Code

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

import java.text.SimpleDateFormat;

public class Main {
    public static int getMonth(long dateTimeMillis) {
        SimpleDateFormat format = new SimpleDateFormat("MM");
        StringBuilder dateString = new StringBuilder(
                format.format(dateTimeMillis));
        return Integer.parseInt(dateString.toString()) - 1;
    }/*from   www  . ja v  a  2s . co  m*/
}