Here you can find the source of fastDateWriteWeeks(LocalDate localDate)
public static char[] fastDateWriteWeeks(LocalDate localDate)
//package com.java2s; //License from project: Open Source License import java.time.LocalDate; import java.time.temporal.TemporalField; import java.time.temporal.WeekFields; import java.util.Locale; public class Main { private static final TemporalField weekOfYear = WeekFields.of(Locale.GERMANY).weekOfWeekBasedYear(); private static final TemporalField yearOfWeek = WeekFields.of(Locale.GERMANY).weekBasedYear(); public static char[] fastDateWriteWeeks(LocalDate localDate) { char[] c = new char[7]; int y = localDate.get(yearOfWeek); c[0] = (char) ('0' + y / 1000); c[1] = (char) ('0' + ((y % 1000) / 100)); c[2] = (char) ('0' + ((y % 100) / 10)); c[3] = (char) ('0' + (y % 10)); c[4] = (char) ('W'); int w = localDate.get(weekOfYear); c[5] = (char) ('0' + (w / 10)); c[6] = (char) ('0' + (w % 10)); return c; }//w ww .jav a 2 s .com }