Android Timestamp Get getLastOfYear(Timestamp t1)

Here you can find the source of getLastOfYear(Timestamp t1)

Description

get Last Of Year

Declaration

public static Timestamp getLastOfYear(Timestamp t1) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;

import java.util.Calendar;

import java.util.GregorianCalendar;

public class Main {
    public static Timestamp getLastOfYear(Timestamp t1) {
        Calendar a = new GregorianCalendar();
        a.setTime(t1);/* w  w w  .j a  v a  2 s  .  c o  m*/
        a.set(Calendar.MONTH, 11);
        a.set(Calendar.DATE, 1);// ???????????12??????
        a.roll(Calendar.DATE, -1);// ???????????????????????
        return new Timestamp(a.getTimeInMillis());
    }
}

Related

  1. getCurrentWeek(Timestamp t1)
  2. getFirstOfMonth(Timestamp t1)
  3. getFirstOfYear(Timestamp t1)
  4. getFriendlyTimeStamp()
  5. getLastOfMonth(Timestamp t1)
  6. getRelativeTimeofTweet(String timeStamp)
  7. getTimestamp(Timestamp timestamp, int day, int hour, int minute)
  8. getWeekOfYear(Calendar cal, Timestamp ts)
  9. getTimeStamp()