Java Month Get getMonth1D()

Here you can find the source of getMonth1D()

Description

get Month D

License

Apache License

Declaration

public static Date getMonth1D() 

Method Source Code

//package com.java2s;
/**/*from w w  w .  j  a v  a2 s .  co  m*/
  *  Copyright (c) 2014 http://www.lushapp.wang
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  */

import java.util.*;

public class Main {
    public static Date getMonth1D() {
        return getMonth1D(new Date());
    }

    public static Date getMonth1D(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        return calendar.getTime();
    }
}

Related

  1. getMonth(String startTime)
  2. getMonth(String str_date)
  3. getMonth(String strDate)
  4. getMonth(String strDate)
  5. getMonth(String tempdat, Locale locale)
  6. getMonthAdd(String operateDate, int flag)
  7. getMonthAndDate()
  8. getMonthBefore(Date d, int number)
  9. getMonthBegin(String strdate)