Java Timestamp Field getEndTimeOfMonth(Timestamp timestamp)

Here you can find the source of getEndTimeOfMonth(Timestamp timestamp)

Description

get End Time Of Month

License

Open Source License

Declaration

public static Timestamp getEndTimeOfMonth(Timestamp timestamp) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {
    public static Timestamp getEndTimeOfMonth(Timestamp timestamp) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(timestamp.getTime());
        calendar.set(Calendar.DAY_OF_MONTH,
                calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
        calendar.set(Calendar.HOUR_OF_DAY,
                calendar.getActualMaximum(Calendar.HOUR_OF_DAY));
        calendar.set(Calendar.MINUTE,
                calendar.getActualMaximum(Calendar.MINUTE));
        calendar.set(Calendar.SECOND,
                calendar.getActualMaximum(Calendar.SECOND));
        calendar.set(Calendar.MILLISECOND,
                calendar.getActualMaximum(Calendar.MILLISECOND));
        return new Timestamp(calendar.getTimeInMillis());
    }//ww  w .j av a2  s  .c o  m
}

Related

  1. getDiscrepancyNum(Timestamp time1, Timestamp time2)
  2. getDouble(Timestamp ts)
  3. getDuration(final Timestamp start, final Date end)
  4. getDurationHour(Timestamp time1, Timestamp time2, String direction)
  5. getDurationMinute(Timestamp createTime, Timestamp finishTime)
  6. getEndTimeStampOfDate(Date date)
  7. getFormattedDateTimeColumn(final Timestamp ts, final SimpleDateFormat formatDate)
  8. getFormattedTimeStamp(long millisSince1970)
  9. getFromTimestamp(Timestamp timestamp)