Android Calendar Get getFirstOfWeek(Calendar cal, int week)

Here you can find the source of getFirstOfWeek(Calendar cal, int week)

Description

get First Of Week

Declaration

public static Timestamp getFirstOfWeek(Calendar cal, int week) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {
    public static Timestamp getFirstOfWeek(Calendar cal, int week) {
        if (cal == null) {
            cal = Calendar.getInstance();
        }//from   w w  w .j  a  va  2  s.co m
        cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return new Timestamp(cal.getTimeInMillis());
    }
}

Related

  1. getDateAsF()
  2. getDateAss()
  3. getDateMin()
  4. getDay()
  5. getDay(Calendar c)
  6. getFragmentInDays(Calendar calendar, int fragment)
  7. getFragmentInHours(Calendar calendar, int fragment)
  8. getGuessedDateString()
  9. getHour(Calendar c)