Sunday 10 July 2022

How to get current weeks Tuesday date

Following program return the current weeks Tuesday date.

 


CurrentWeekTuesdayDate.java

package com.sample.app;

import java.util.Calendar;

public class CurrentWeekTuesdayDate {

	public static void main(String[] args) {
		Calendar calendar = Calendar.getInstance();
		calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);
		
		System.out.println("Date " + calendar.getTime());

	}

}

Output

Date Sat Jul 09 21:11:19 IST 2022


 

Previous                                                 Next                                                 Home

No comments:

Post a Comment