Android Calendar Get getCurrentWeek()

Here you can find the source of getCurrentWeek()

Description

get Current Week

Declaration

public static String getCurrentWeek() 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    public static String getCurrentWeek() {
        return getWeek(Calendar.getInstance());
    }//  w  ww.  j a  v  a2 s. com

    public static String getWeek(final Long date) {
        final Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(date);
        return getWeek(calendar);
    }

    public static String getWeek(final Calendar calendar) {
        final int weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR);
        return String.valueOf(weekOfYear);
    }
}

Related

  1. GetCurrentTime_String()
  2. GetCurrentTime_UTCMilliSeconds()
  3. GetCurrentTime_UTCSeconds()
  4. getCurrentMonth()
  5. getCurrentTimeStr()
  6. getCurrentWeek()
  7. getCurrentWeek(Calendar cal)
  8. getDate()
  9. getDate()