Here you can find the source of getMonth(String day)
public static String getMonth(String day)
//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 }