Java tutorial
//package com.java2s; import java.util.GregorianCalendar; import java.util.TimeZone; public class Main { private static final TimeZone GMT = TimeZone.getTimeZone("GMT"); public static long currentWeekInMills() { GregorianCalendar gregoriancalendar = new GregorianCalendar(); GregorianCalendar gregoriancalendar1 = new GregorianCalendar(gregoriancalendar.get(1), gregoriancalendar.get(2), gregoriancalendar.get(5)); gregoriancalendar1.setTimeZone(GMT); gregoriancalendar1.add(6, -(gregoriancalendar.get(7) - gregoriancalendar.getFirstDayOfWeek())); return gregoriancalendar1.getTimeInMillis(); } }