Skip to content

Instantly share code, notes, and snippets.

@tyoshikawa1106
Last active January 18, 2017 08:01
Show Gist options
  • Save tyoshikawa1106/11242040 to your computer and use it in GitHub Desktop.
Save tyoshikawa1106/11242040 to your computer and use it in GitHub Desktop.
Apex : 月初日付と月末日付取得
/**
* 月初日付取得
*/
public static Date getMonthOfStartDay(Date prmDate) {
return prmDate != null ? Date.newInstance(prmDate.year(), prmDate.month(), 1) : null;
}
/**
* 月末日付取得
*/
public static Date getMonthOfEndDay(Date prmDate) {
return prmDate != null ? Date.newInstance(prmDate.year(), prmDate.month() + 1 ,0) : null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment