epoch->calendar date(1) wizardry

markzero mark at darklogik.org
Mon May 30 03:46:28 PDT 2005


On Mon, May 30, 2005 at 01:32:37PM +0300, Giorgos Keramidas wrote:
> On 2005-05-30 03:35, markzero <mark at 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.

Sounds good.

I think the main problem was the fact that I had everything upside
down and back to front.

Cheers!
Mark

-- 
pgp: http://www.darklogik.org/pub/pgp/pgp.txt
B776 43DC 8A5D EAF9 2126 9A67 A7DA 390F DEFF 9dD1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 825 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050530/054489f8/attachment.bin


More information about the freebsd-questions mailing list