所有,
我想知道从给定日期开始的上周三的日期.
例如.我的日期为"20150804",我需要"20150729".
DateTime不可用,我也无法安装它.
我看了几个例子,但他们正在使用DateTime.
你可以转发我的地方,我可以得到一些帮助吗?谢谢.
我打算编写类似下面的代码.
码:
#!/opt/perl-5.8.0/bin/perl
use warnings;
use strict;
my $dt="20150804";
my $prevWednesday=getPrevWednesday($dt);
sub getPrevWednesday()
{
my $givenDt=shift;
...
}
Run Code Online (Sandbox Code Playgroud)