Java Calendar using Calendar.DAY_OF_WEEK to get the first and the last dates for a particular date

前端 未结 3 1991
不知归路
不知归路 2021-01-28 19:49

In my application there lies a code which works abruptly sometimes, its about getting a week interval using the java calendar object through Calendar.DAY_OF_WEEK. The code check

3条回答
  •  一个人的身影
    2021-01-28 20:02

    I guess you have to set the start of week to monday, otherwise last sunday IS the sunday of the week.

    setFirstDayOfWeek

    public void setFirstDayOfWeek(int value)

    Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
    
    **Parameters:**
        value - the given first day of the week.
    

    Java Calender Doc

提交回复
热议问题