Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jun 2009 16:07:11 -0500
From:      Kirk Strauser <kirk@strauser.com>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Date representation as YY/DDD or YYYY/DDD
Message-ID:  <200906031607.11697.kirk@strauser.com>
In-Reply-To: <20090603230314.bfeecf1a.freebsd@edvax.de>
References:  <20090603230314.bfeecf1a.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 03 June 2009 04:03:14 pm Polytropon wrote:

> I'm looking to an existing way to output a date in the format
> YY/DDD, where YY is the year (last two digits) and DDD is the
> of the year, starting from 1, preceeded by zeroes if needed,
> and YYYY/DDD, where YYYY is the year with four digits, such
> as 2009-01-01 would be 09/001, 2009-02-01 would be 2009/032.

Like this?

$ date +'%y/%j'
09/154
$ date +'%Y/%j'
2009/154
-- 
Kirk Strauser



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906031607.11697.kirk>