On Sun, 30 Dec 2012, Assaf Gordon wrote:

> Sometimes old ways are the simplest (even if not pure Perl):
>
>     $ date -d "2012-12-30 12pm + 10 days"
>     Wed Jan  9 12:00:00 EST 2013
>     $ date -d "2012-12-30 12pm - 10 days"
>     Thu Dec 20 12:00:00 EST 2012
>
> To print just the date:
>     $ date -d "2012-12-30 12pm + 10 days" +%F
>     2013-01-09
>
> Or just the day:
>     $ date -d "2012-12-30 12pm + 10 days" +%A
>     Wednesday
>
> The "12pm" is there to avoid leap-day related surprises.

That's acutally quite useful.

-- 
Shlomo Yona
[email protected]
http://yeda.cs.technion.ac.il/~yona/
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to