Javatpoint Logo
Javatpoint Logo

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

Test it Now

Output:

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

Example 2

Test it Now

Output:

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


Please Share

facebook twitter google plus pinterest