Skip to Content.
Sympa Menu

baslinux - Re: [BL] Another UNIX question

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: 3aoo-cvfd AT dea.spamcon.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] Another UNIX question
  • Date: Mon, 20 Nov 2006 11:40:52 +1300

Sheldon Isaac wrote:
>
> The purpose is to find out how many days it is until Jan 15 2007.
> Under BL 3.40 here, it gives errors right away; wrong syntax.
> Can someone tell my how to do it?

Why don't you use the following to get how
many days have elapsed in the current year:
--------
date +%j
--------
Subtract it from 365 and add it to 15
(the number of days from the end of the
current year to Jan 15).

Or, if your future date is not fixed, you can
use the following to get how many seconds have
elapse since year zero (1970):
--------
date +%s
--------
Get the seconds for both dates, subtract and
that will tell you the number of seconds between
the two. Divide by 86400 (the number of seconds
in a day) to get the number of days between the
two.

Cheers,
Steven




Archive powered by MHonArc 2.6.24.

Top of Page