get Last Day Of Year - Java java.util

Java examples for java.util:Year

Description

get Last Day Of Year

Demo Code


//package com.java2s;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static void main(String[] argv) throws Exception {
        Date date = new Date();
        System.out.println(getLastDayOfYear(date));
    }/*w  w w.  j  a  v a  2s  .c  om*/

    public static String getLastDayOfYear(Date date) {
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-12-31");
        return sf.format(date);
    }
}

Related Tutorials