Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate week number for given date Android

I am trying to get the the current week number from the given date. i.e. If I enter the date as 01/03/2013 then i should get the week number which is 9..

Please help me in finding the solution..

Thanks..

Abhishek..

like image 718
Abhishek Dhiman Avatar asked Mar 01 '13 09:03

Abhishek Dhiman


1 Answers

You can create a Calendar object for that date and get the week with calendar.get(Calendar. WEEK_OF_YEAR). The API is described here: http://developer.android.com/reference/java/util/Calendar.html#WEEK_OF_YEAR

like image 164
azertiti Avatar answered Oct 11 '22 12:10

azertiti