Java Calendar setWeekDate() Method

The setWeekDate() method of java.util.Calendar class sets the current date with specified integer value as the parameter. These values are the weekYear, weekOfYear, and dayOfWeek.

Syntax

Parameter

weekYear - the week year

weekOfYear - the week number based on weekYear

dayOfWeek - the day of the week value:

Returns

NA

Throws

NA

Example 1

Output:

Time Today:Sat Aug 18 10:57:54 PDT 2018
Now Time Today:Fri Jun 07 10:57:54 PDT 1996

Example 2

Output:

Time Today(mycal):Sat Aug 18 11:21:42 PDT 2018
Time Today (mycal2):Sat Aug 18 11:21:42 PDT 2018