Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 May 2005 13:32:37 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        markzero <mark@darklogik.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: epoch->calendar date(1) wizardry
Message-ID:  <20050530103237.GA42500@orion.daedalusnetworks.priv>
In-Reply-To: <20050530023552.GA63697@logik.ath.cx>
References:  <20050530023552.GA63697@logik.ath.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-05-30 03:35, markzero <mark@darklogik.org> 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

	$ date -j -f '%s' 1117417465 '+%Y/%m/%d %T %z'
	2005/05/30 04:44:25 +0300

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.




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