I am executing the below Java code:
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
System.out.println(cal.get(Calendar.WEEK_OF_YEAR));
System.out.println(cal.getTime());
output:
28
Fri Jul 08 08:56:04 BST 2016
Below is the command I executed in MYSQL:
select week(CURDATE()), CURDATE();
Output:
27 2016-07-08
How to sync the both the week of the year value? I tried week(CURDATE(),0)
still same result, without TimeZone
also tried but getting same result.