use Date::Manip::Date;
$d = Date::Manip::Date->new;
for (36,18,-17,7,-45) {
$d->parse(111111 . $_);
print substr $d->printf("%j%a%p%h" x 4), -$_, 1;
}
print "\n";
- Intermediate question
- The date format has the four letters j a p h. Of the four letters in the output, which one do we extract from the output of which format letter?
- Advanced question
- This code will stop working about 45 days after it's posted. How can you fix the code so it works even after that date? I'll show a solution inside the spoiler, in case someone arrives here too late and wants to try this obfu.
- Expert question
- Among the five loop iterations, the string is parsed in five different ways. How many of these are deliberate features of Date::Manip?
Update 2023-02-07T22:53Z: improved the obfuscation by changing the list of numbers from 36,18,2,7,-45 to 36,18,-17,7,-45. Now the obfuscation outputs JaPh instead of Japh and the five iterations parse the date in five different formats rather than just four. There's one drawback: