Get starting date of week(configurable starting day of week)

前端 未结 4 415
暖寄归人
暖寄归人 2021-01-20 04:57

I have current date, and a constant which tells from which day the week starts. I want to get the start date of the week based on that constant. If I hardcode the first day

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-20 05:07

    From the java calendar API http://docs.oracle.com/javase/6/docs/api/java/util/Calendar.html#getFirstDayOfWeek()

    public int getFirstDayOfWeek()
    Gets what the first day of the week is; e.g., SUNDAY in the U.S., MONDAY in France.
    Returns:
    the first day of the week.
    See Also:
    

提交回复
热议问题