|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: [PLUG] Making sense of UNIX time_t ("epoch seconds")
|
- From: Mike Chirico <mchirico@gmail.com>
- To: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
- Subject: Re: [PLUG] Making sense of UNIX time_t ("epoch seconds")
- Date: Sun, 15 Jul 2007 14:35:31 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=ZqYTBDeFfcS8XK5xGQQwDir2f0ndfAkvUFN3u1afqWWN8L7oRNqRHbn3PnYzGIC7dq8ZtIyR/uZZc6x+En4wzMDgQYqdZp27qA/TAP9OM+1nsIipQdq06GhfhHiNup1KAmRmgDcJxpilEcANsdpdFs5CIxoYYiPJEr8v8k2+9hs=
- Reply-to: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
- Sender: plug-bounces@lists.phillylinux.org
- User-agent: Mutt/1.4.1i
On Sun, Jul 15, 2007 at 02:14:56PM -0400, Antony P Joseph wrote:
> Hi
> On Sun, 2007-07-15 at 13:52 -0400, Matthew Rosewarne wrote:
>
> > through a number of online converters and perl scripts, I found a good way to
> > do it with plan old /bin/date:
> >
> > date -d "1970-01-01 $TIMESTAMP sec"
> >
> > So for example, if you entered:
> >
> > date -d "1970-01-01 1184521826 sec"
> There is a catch here epoch is in GMT. While date will look into local
> time variable. So the correct will be date -d " local epoch time()"
>
It's easy to correct for GMT, just append GMT after sec.
date -d "1970-01-01 1184521826 sec GMT"
Which will give the following, correct, local time.
Sun Jul 15 13:50:26 EDT 2007
Regards,
Mike
___________________________________________________________________________
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|