Qmail
[Top] [All Lists]

Re: tai64n date format

To: qmail@list.cr.yp.to
Subject: Re: tai64n date format
From: Sami Farin <safari-qmail@safari.iki.fi>
Date: Sun, 1 Apr 2007 21:51:19 +0300
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-qmail@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list qmail@list.cr.yp.to
In-reply-to: <a3bd4fe00704011137s6186d8c6v60f5c4d200fb47ad@mail.gmail.com>
Mail-followup-to: qmail@list.cr.yp.to
Mailing-list: contact qmail-help@list.cr.yp.to; run by ezmlm
References: <a3bd4fe00704011052n1132c340k1320805947292f73@mail.gmail.com> <20070401181250.GA11214@odin.dempsky.org> <a3bd4fe00704011137s6186d8c6v60f5c4d200fb47ad@mail.gmail.com>
User-agent: Mutt/1.5.14 (2007-02-12)
On Sun, Apr 01, 2007 at 14:37:35 -0400, Vahid Moghaddasi wrote:
> On 4/1/07, Matthew R. Dempsky <mrd@alkemio.org> wrote:
> >
> >You can pipe the files through tai64nlocal.  E.g.,
> >
> >$ echo @40000000460feea82f23d924 log data | tai64nlocal
> >2007-04-01 12:40:23.790878500 log data
> >
> Yes, but I want the other way around, e.g. echo "2007-04-01
> 12:40:23.790878500" | lacoln46iat (the opposite of tai64nlocal) and
> get TAI equivalent of @40000000460feea82f23d924 as the output. I am
> only interested in date, hour, minute.
> Thanks,

$ printf "@%x00000000\n" $(( $(date -d "2007-04-01 20:40:46.790878500" "+%s") + 
4611686018427387914 ))
@40000000460feea800000000
$ echo @40000000460feea800000000 | tai64nlocal
2007-04-01 20:40:46.000000000

-- 

Attachment: pgpKVXjs4Xn7i.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>