Here you can find the source of getWeekName()
public static String getWeekName()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static final String PATTERN = "yyyy-MM-dd"; public static String getWeekName() { return getCurrentTime("yyyy") + getWeekOfYear(); }// w w w . ja v a2 s.com public static String getCurrentTime() { return getCurrentTime(null); } public static String getCurrentTime(String pattern) { return parseDate2String(new Date(), pattern); } public static String getWeekOfYear() { String num = Calendar.getInstance().get(Calendar.WEEK_OF_YEAR) + ""; return num.length() == 1 ? "0" + num : num; } public static String parseDate2String(Date date, String pattern) { return getSimpleDateFormatInstance(pattern).format(date); } public static String parseDate2String(Date date) { return parseDate2String(date, null); } private static SimpleDateFormat getSimpleDateFormatInstance(String pattern) { return new SimpleDateFormat(pattern == null ? PATTERN : pattern); } }