Java Year From getYearMonth(String day)

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

Description

get Year Month

License

Apache License

Declaration

public static String getYearMonth(String day) 

Method Source Code

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

public class Main {

    public static String getYearMonth(String day) {
        if (day == null)
            return "";
        if (day.length() < 8)
            return "";
        int n = day.lastIndexOf("-");
        return day.substring(0, n);
    }//  w w w.  jav a2s. c o m
}

Related

  1. getYearFromDay(int days)
  2. getYearFromISODate(String isoDate)
  3. getYearFromTimestamp(long ms)
  4. getYearFromWeekCode(String weekCode)
  5. getYearFromYM(String ym)
  6. getYearMonthArray(Integer yearMonth)
  7. getYearMonthDays(int year, int month)
  8. getYearNumberofdays(String date)
  9. getYearOfDayMark(int day)