From owner-freebsd-questions@FreeBSD.ORG Wed Jun 3 21:07:17 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61D221065673 for ; Wed, 3 Jun 2009 21:07:17 +0000 (UTC) (envelope-from kirk@strauser.com) Received: from kanga.honeypot.net (kanga.honeypot.net [IPv6:2001:470:a80a:1:21f:d0ff:fe22:b8a8]) by mx1.freebsd.org (Postfix) with ESMTP id 23B9B8FC21 for ; Wed, 3 Jun 2009 21:07:17 +0000 (UTC) (envelope-from kirk@strauser.com) Received: from localhost (localhost [127.0.0.1]) by kanga.honeypot.net (Postfix) with ESMTP id ADC2121347 for ; Wed, 3 Jun 2009 16:07:16 -0500 (CDT) X-Virus-Scanned: amavisd-new at honeypot.net Received: from kanga.honeypot.net ([127.0.0.1]) by localhost (kanga.honeypot.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SRwiEkmQpGvJ for ; Wed, 3 Jun 2009 16:07:14 -0500 (CDT) Received: from athena.localnet (athena.daycos.com [IPv6:2001:470:c054:1:221:9bff:fe00:de3f]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by kanga.honeypot.net (Postfix) with ESMTPSA id 3D3B22133F for ; Wed, 3 Jun 2009 16:07:14 -0500 (CDT) From: Kirk Strauser To: FreeBSD Questions Date: Wed, 3 Jun 2009 16:07:11 -0500 User-Agent: KMail/1.11.4 (Linux/2.6.28-11-generic; KDE/4.2.4; x86_64; ; ) References: <20090603230314.bfeecf1a.freebsd@edvax.de> In-Reply-To: <20090603230314.bfeecf1a.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906031607.11697.kirk@strauser.com> Subject: Re: Date representation as YY/DDD or YYYY/DDD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2009 21:07:17 -0000 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