Java Timestamp getTimeNextMonthFirstSec(Timestamp sysDate)

Here you can find the source of getTimeNextMonthFirstSec(Timestamp sysDate)

Description

get Time Next Month First Sec

License

Apache License

Declaration

public static Timestamp getTimeNextMonthFirstSec(Timestamp sysDate) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {

    public static Timestamp getTimeNextMonthFirstSec(Timestamp sysDate) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(sysDate);/*from  w ww  .  jav  a  2s  .  c  o m*/
        calendar.add(Calendar.MONTH, 1);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.SECOND, 0);
        return new Timestamp(calendar.getTimeInMillis());
    }
}

Related

  1. getCurTimestamp()
  2. getTimeDifference(Timestamp startTime, Timestamp endTime)
  3. getTimeFromTimestamp( java.sql.Timestamp tsZeitpunkt)
  4. getTimeNanoSec(Timestamp t)
  5. getTimeNextDay(Timestamp date)
  6. getTimePassedSince(Timestamp timestamp)
  7. getTimeStr(Timestamp tsp)
  8. getTimeString(java.sql.Timestamp ts)
  9. getTimeString(Timestamp timestamp)