Get year from java.util.Date

import java.text.SimpleDateFormat;
import java.util.Date;

public class Test {
  public static void main(String args[]) throws Exception {
    Date date = new Date();
    SimpleDateFormat simpleDateformat = new SimpleDateFormat("yyyy");
    System.out.println("Year: " + simpleDateformat.format(date));
  }
}

Comments

Popular posts from this blog

일본만화 추천 100선

경희대 강연자료