in reply to Date comparison
#!/usr/bin/env perl use warnings; use strict; use feature qw{ say }; use DateTime; my $now = 'DateTime'->now; for my $day (6, 7) { my $dt = 'DateTime'->new(year => 2017, month => 6, day => $day); my $diff = $now - $dt; my ($years, $months) = ($diff->years, $diff->months); say $years == 1 && $months == 2 ? 'Yes' : 'No'; }
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Date comparison
by BillKSmith (Monsignor) on Aug 06, 2018 at 22:47 UTC |