On Sat, 22 Sep 2001 08:43:04 -0400  Joel Hammer wrote:
> Is there a builtin function to use with bash scripts to manipulate dates,
> for example, to subtract two dates or two times and get the difference
> between them?
> Thanks,
> Joel

I use perl. There is a module in particular that has functions :

use Date::Calc qw(
             Date_to_Days
             Delta_Days
             Add_Delta_Days
             Add_Delta_DHMS
         );

$days = Delta_Days($y1, $m1, $d1, $y2, $m2, $d2); # days between 2 dates

($y, $m, $d) = Add_Delta_Days($oldy, $oldm, $oldd, $days); # add days to a date

plus many, many more...
-- 
-----------------------------------------------------------------------
| Alan K. Jackson            | To see a World in a Grain of Sand      |
| [EMAIL PROTECTED]          | And a Heaven in a Wild Flower,         |
| www.ajackson.org           | Hold Infinity in the palm of your hand |
| Houston, Texas             | And Eternity in an hour. - Blake       |
-----------------------------------------------------------------------

_______________________________________________
http://linux.nf -- [EMAIL PROTECTED]
Archives, Subscribe, Unsubscribe, Digest, Etc 
->http://linux.nf/mailman/listinfo/linux-users

Reply via email to