Here you can find the source of formattedWeek(LocalDateTime localDateTime)
static public String formattedWeek(LocalDateTime localDateTime)
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; import java.time.temporal.WeekFields; import java.util.Locale; public class Main { static public String formattedWeek(LocalDateTime localDateTime) { return String.format("%04d-%02d", localDateTime.getYear(), localDateTime.get(WeekFields.of(Locale.getDefault()) .weekOfWeekBasedYear())); }//from w w w.j av a2 s . co m }