set End Of Date - Java java.util

Java examples for java.util:Calendar Calculation

Description

set End Of Date

Demo Code


//package com.java2s;
import java.util.Calendar;

public class Main {
    public static void main(String[] argv) throws Exception {
        Calendar calendar = Calendar.getInstance();
        System.out.println(setEndOfDate(calendar));
    }//from w  ww  .j  a  v a 2  s .co  m

    public static Calendar setEndOfDate(Calendar calendar) {
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        calendar.set(Calendar.MINUTE, 59);
        calendar.set(Calendar.SECOND, 59);
        calendar.set(Calendar.MILLISECOND, 999);
        return calendar;
    }
}

Related Tutorials