I am trying to get week number for a given date. But its working for few dates and not working for couple of dates.
Followed this link https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
select from_unixtime(unix_timestamp('2015-12-31','yyyy-MM-dd'),'w') week_in_year;
The above code is returning 1
select from_unixtime(unix_timestamp('2016-12-31','yyyy-MM-dd'),'w') week_in_year;
The above code is returning 53. I think the first code snippet also should give something like 53/52. Any help is appreciated in solving.