Here you can find the source of getFirstDayOfMonth(int year, int month)
Parameter | Description |
---|---|
year | a parameter |
month | a parameter |
public static String getFirstDayOfMonth(int year, int month)
//package com.java2s; /**//from w ww. j a va 2 s . c o m * Copyright (c) 2012-2014 http://www.eryansky.com * * Licensed under the Apache License, Version 2.0 (the "License"); */ public class Main { /** * get first date of given month and year * * @param year * @param month * @return */ public static String getFirstDayOfMonth(int year, int month) { String monthStr = month < 10 ? "0" + month : String.valueOf(month); return year + "-" + monthStr + "-" + "01"; } }