How to calculate a date a week ago from today

前端 未结 4 1409
终归单人心
终归单人心 2021-01-13 09:08

I wanna calculate the date a week ago from today with a specific format and put it in to a variable. For example, today is Nov 21st. 2014, and I wanna print out

4条回答
  •  悲哀的现实
    2021-01-13 09:44

    This is very simple using Date::Manip

        use Date::Manip;
        my $today = ParseDate("today");
        my $weeksago = DateCalc($today,"-7d");
    

提交回复
热议问题