Java Timestamp Field getDayEnd(java.sql.Timestamp stamp, int daysLater)

Here you can find the source of getDayEnd(java.sql.Timestamp stamp, int daysLater)

Description

get Day End

License

Open Source License

Declaration

public static java.sql.Timestamp getDayEnd(java.sql.Timestamp stamp, int daysLater) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    public static java.sql.Timestamp getDayEnd(java.sql.Timestamp stamp) {
        return getDayEnd(stamp, 0);
    }/*from   w w w .j  a  v  a2 s . c  o  m*/

    public static java.sql.Timestamp getDayEnd(java.sql.Timestamp stamp, int daysLater) {
        Calendar tempCal = Calendar.getInstance();

        tempCal.setTime(new java.util.Date(stamp.getTime()));
        tempCal.set(tempCal.get(Calendar.YEAR), tempCal.get(Calendar.MONTH), tempCal.get(Calendar.DAY_OF_MONTH), 23,
                59, 59);
        tempCal.add(Calendar.DAY_OF_MONTH, daysLater);
        return new java.sql.Timestamp(tempCal.getTime().getTime());
    }
}

Related

  1. getDateTimeFromTimeStamp(Timestamp timestamp)
  2. getDateTimestamp(ResultSet rs, String columnLabel)
  3. getDateTimeStr(Timestamp timestamp)
  4. getDateTimeString(java.sql.Timestamp ts)
  5. getDayBorder(Timestamp dateTime, Timestamp timeSlot, boolean end)
  6. getDayOfMonthBy(Timestamp ts)
  7. getDayOfTime(Timestamp timestamp)
  8. getDayOfWeek(Timestamp timestamp)
  9. getDaysBetween(Timestamp start, Timestamp end)