Java Week getWeekNumberFromDate(String thedate)

Here you can find the source of getWeekNumberFromDate(String thedate)

Description

get Week Number From Date

License

Open Source License

Declaration

public static String getWeekNumberFromDate(String thedate) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getWeekNumberFromDate(String thedate) {
        String strReturn = "";
        SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String dateStringToParse = thedate;
        try {//from   w  w w.jav a 2  s.  c  o m
            Date date = bartDateFormat.parse(dateStringToParse);
            SimpleDateFormat bartDateFormat2 = new SimpleDateFormat("yyyy-MM-dd EEEE");
            strReturn = bartDateFormat2.format(date);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return strReturn;
    }
}

Related

  1. getWeekFromDate(String dateString)
  2. getWeekId(String date)
  3. getWeekInMonth()
  4. getWeekName()
  5. getWeekNumber(String sdate)
  6. getWeekNumByDate(String date)
  7. getWeekNumner(String date)
  8. getWeekOfMonth()
  9. getWeekStartDate(Integer weekNumber)