How to get ordinal Weekdays in a Month

前端 未结 4 865
借酒劲吻你
借酒劲吻你 2020-12-22 02:21

hi i want to make a program in java where days,weekNo is parameter ..Like First Friday of the month or second Monday of the month ..and it returns the date

4条回答
  •  無奈伤痛
    2020-12-22 03:03

    Calendar cal = Calendar.getInstance();
    int dayofweek = cal.get(Calendar.DAY_OF_WEEK);
    

    this should do what you want.
    edit: with some more calculate steps, you could have result :) (sorry for confuse your title)

提交回复
热议问题