From owner-freebsd-questions@FreeBSD.ORG Mon May 30 10:46:28 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BB7616A41C for ; Mon, 30 May 2005 10:46:28 +0000 (GMT) (envelope-from markzero@logik.ath.cx) Received: from addr9.addr.com (addr9.addr.com [209.249.147.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36F2843D1F for ; Mon, 30 May 2005 10:46:28 +0000 (GMT) (envelope-from markzero@logik.ath.cx) Received: from logik.ath.cx (localhost [127.0.0.1]) by addr9.addr.com (8.12.11/8.12.8/Submit) with ESMTP id j4UAkMVA068134; Mon, 30 May 2005 03:46:23 -0700 (PDT) Received: by logik.ath.cx (Postfix, from userid 1001) id 949BC611B; Mon, 30 May 2005 11:46:22 +0100 (BST) Date: Mon, 30 May 2005 11:46:22 +0100 From: markzero To: Giorgos Keramidas Message-ID: <20050530104622.GA59664@logik.ath.cx> References: <20050530023552.GA63697@logik.ath.cx> <20050530103237.GA42500@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20050530103237.GA42500@orion.daedalusnetworks.priv> X-GPG-Key: http://darklogik.org/pub/pgp/pgp.txt X-Fingerprint: B776 43DC 8A5D EAF9 2126 9A67 A7DA 390F DEFF 9DD1 X-ADDRSpamFilter: Passed, probability (10%) X-ADDRSignature: 1BC391F6 Cc: freebsd-questions@freebsd.org Subject: Re: epoch->calendar date(1) wizardry 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: Mon, 30 May 2005 10:46:28 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 30, 2005 at 01:32:37PM +0300, Giorgos Keramidas wrote: > On 2005-05-30 03:35, markzero wrote: > > Hello, > > How may one pretty print an epoch timestamp using date(1)? The date > > manual page gives me a headache. > > > > Essentially, I have the timestamp in a file: > > > > $ cat t > > 1117417465 >=20 > $ date -j -f '%s' 1117417465 '+%Y/%m/%d %T %z' > 2005/05/30 04:44:25 +0300 >=20 > The -j and -f options, when combined together, can help you convert > practically any format that strptime(3) can read and parse to any time > strftime(3) can print. Sounds good. I think the main problem was the fact that I had everything upside down and back to front. Cheers! Mark --=20 pgp: http://www.darklogik.org/pub/pgp/pgp.txt B776 43DC 8A5D EAF9 2126 9A67 A7DA 390F DEFF 9dD1 --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iQIVAwUBQpru/afaOQ/e/53RAQpWLhAAlSPNScY2HO0ioC+oia7WUFb6KXAiiA9Q UkNiXpHGsugXXZvH9IDUwVeOhSBkoAboLfquUBvcMEgr9nPfRhMKzc960OwU4Kpb 6spf4m6gLaPCFUe4DbFCK6nkpCPehklpPted3k6EQ87ZlRXlVeC9F6RBuwa5lveb oShm5ac5zEDyrX14mQ7ZA7huwd60ALoszTMl+N8ZeT9j/GUL+IQftt+pC4RZaqL2 /sWFp1qkppB+ymqWZoqo4TCEIatGrmtWPXhblaDPStgm5Kfs2De8PsNy0wdLpCPR sKt2+jz3zCqBQ1EE1tMR04ypD+DKWdgvV+8ckk30WchtMc9zIS3A89SbvyI0KmSm FoFLZ1FCmVd7jWeWvFF2Imc8Wl2cvhmOHBGB/7cVQ5cGvq3EarlTpXH3sYcXH5zN VMrQ+aOWXkCGciwawJFGDp61/VqNHPQUQC7eMJ/ky/OOEIZ77DCb7U/H3ZtYxB+F BT9fE07W29CigndrgqvsdJrIMNh66Obm5yrgAeYsmF6Qt97V1NWOqSzewT9GxVN/ IcIx30oCsGcFr4GL+jPBeKkkrEqNFQIEquuReZWjl/Dr0f9v1iyE1Fq88LvFMbvY x2+MJ/V+BAFj28ECsVH9MTnMD1h9yYJ3hIJ6xKsGCbKJWNY9PwD7ik81Rv89shDh cPkxqVA4q0I= =c3iS -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--