Here you can find the source of formatMonth(final int year, final int month)
Parameter | Description |
---|---|
year | a parameter |
month | 0-11 |
public static String formatMonth(final int year, final int month)
//package com.java2s; // ProjectForge is dual-licensed. public class Main { /**/* w w w. j a v a 2s . com*/ * @param year * @param month 0-11 * @return "yyyy-mm" */ public static String formatMonth(final int year, final int month) { final StringBuffer buf = new StringBuffer(); buf.append(year); if (month >= 0) { buf.append('-'); final int m = month + 1; if (m <= 9) { buf.append('0'); } buf.append(m); } return buf.toString(); } }