In Perl how to find the date of the previous Monday for a given date?

后端 未结 9 1024
深忆病人
深忆病人 2020-12-11 03:48

I am looking for a Perl script which can give me the last Monday for any specified date.

e.g. For date 2011-06-11, the script should return 2011-06-06

9条回答
  •  自闭症患者
    2020-12-11 04:29

    Zeller's congruence will give you the day of the week. From there it should be pretty easy.

提交回复
热议问题