Java Month Get getMonth(String date)

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

Description

get Month

License

Open Source License

Parameter

Parameter Description
date String in the format ..Month and day should be 2 digits

Return

String ..

Declaration


public static String getMonth(String date) 

Method Source Code

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

public class Main {
    /**//from w  w w  .jav a2  s .  c o m
     * @param date String in the format   ..Month and day should be 2 digits
     * @return String ..
     */

    public static String getMonth(String date) {
        return date.substring(0, 2);
    }

    public static String substring(String input, int maxLength) {
        if (input == null)
            return null;
        else
            return (input.length()) <= maxLength ? input : input.substring(0, maxLength);
    }
}

Related

  1. getMonth(long date, int increment)
  2. getMonth(long l)
  3. getMonth(SimpleDateFormat df, String dateStr)
  4. getMonth(String aDate)
  5. getMonth(String date)
  6. getMonth(String date)
  7. getMonth(String dateKey)
  8. getMonth(String datetime)
  9. getMonth(String day)