Java Year From yearFromDate(String date)

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

Description

year From Date

License

Open Source License

Parameter

Parameter Description
date date

Return

year from string date

Declaration

public static String yearFromDate(String date) 

Method Source Code

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

public class Main {
    /**/*from  ww w.  j a v a2 s  .  c o m*/
     * @param date date
     * @return year from string date
     */
    public static String yearFromDate(String date) {
        String dt = date.substring(0, 4);
        return dt;
    }
}

Related

  1. toShortW3CDTF(Date d, boolean yearOnly)
  2. year()
  3. year(Date date)
  4. year(long time)
  5. yearformMatDate(Date date)
  6. yearFromDateValue(long x)
  7. yearFromFileName(String str)
  8. yearOfDate(Date s)
  9. yearsBetween(String from, String to)