Java Month Get getMonth(String day)

Here you can find the source of getMonth(String day)

Description

get Month

License

Apache License

Declaration

public static String getMonth(String day) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String getMonth(String day) {
        if (day == null)
            return "0";
        if (day.length() < 8)
            return "0";
        int m = day.indexOf("-", 0);
        int n = day.lastIndexOf("-");
        String temp = day.substring(m + 1, n);
        if (temp.length() == 1)
            temp = "0" + temp;
        return temp;
    }//from  ww  w. j a va  2s . c o m
}

Related

  1. getMonth(String date)
  2. getMonth(String date)
  3. getMonth(String date)
  4. getMonth(String dateKey)
  5. getMonth(String datetime)
  6. getMonth(String f)
  7. getMonth(String name)
  8. getMonth(String pFormattedDate)
  9. getMonth(String quarters)