Here you can find the source of day2ThuesDay(Date date)
static String day2ThuesDay(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { static String day2ThuesDay(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo")); calendar.setTime(date);/*from www. jav a 2s . c o m*/ int week = calendar.get(Calendar.DAY_OF_WEEK); if (week == Calendar.MONDAY || week == Calendar.SUNDAY) { week += 7; } calendar.add(Calendar.DAY_OF_MONTH, -week); calendar.add(Calendar.DAY_OF_MONTH, Calendar.TUESDAY); SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); return format.format(calendar.getTime()); } }