[Chicago-talk] Calculate Date on SunOS

tiger peng tigerpeng2001 at yahoo.com
Wed Jan 14 20:47:57 PST 2009


Thanks, that's what I am looking for.





________________________________
From: Andrew Rodland <arodland at comcast.net>
To: Chicago.pm chatter <chicago-talk at pm.org>
Sent: Wednesday, January 14, 2009 9:57:52 PM
Subject: Re: [Chicago-talk] Calculate Date on SunOS

On Wednesday 14 January 2009 09:49:55 pm tiger peng wrote:
> Actually, I only want something as simple as GNU's date command:
>
> -> date --date=yesterday +%Y%m%d
> 20090113
> -> date --date="next week" +%Y%m%d
> 20090121
>

$ perl -MPOSIX=strftime -le 'print strftime "%Y%m%d",localtime (time - 86400)'
20090113
$ perl -MPOSIX=strftime -le 'print strftime "%Y%m%d",localtime (time+7*86400)'
20090121

Andrew
_______________________________________________
Chicago-talk mailing list
Chicago-talk at pm.org
http://mail.pm.org/mailman/listinfo/chicago-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20090114/2c0a8b85/attachment.html>


More information about the Chicago-talk mailing list