Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { public static int formatYear(long lefttime) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy", Locale.CHINA); String sDateTime = sdf.format(lefttime); int i = Integer.parseInt(sDateTime); return i; } }