Android Timestamp Get getFirstOfYear(Timestamp t1)

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


get First Of Year


public static Timestamp getFirstOfYear(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 getFirstOfYear(Timestamp t1) {
        Calendar a = new GregorianCalendar();
        a.setTime(t1);/*  w ww  .  ja  v  a2s.  co  m*/
        a.set(Calendar.MONTH, 0);
        a.set(Calendar.DATE, 1);
        return new Timestamp(a.getTimeInMillis());


  1. getCurrentMonth(Timestamp t1)
  2. getCurrentWeek(Timestamp t1)
  3. getFirstOfMonth(Timestamp t1)
  4. getFriendlyTimeStamp()
  5. getLastOfMonth(Timestamp t1)
  6. getLastOfYear(Timestamp t1)
  7. getRelativeTimeofTweet(String timeStamp)