Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Apr 2007 14:30:11 +0930
From:      Greg 'groggy' Lehey <grog@FreeBSD.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, brian@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/usr.bin/touch touch.1 touch.c
Message-ID:  <20070410050011.GH91694@wantadilla.lemis.com>
In-Reply-To: <20070409.222011.1689682576.imp@bsdimp.com>
References:  <20070409021942.C150B16A529@hub.freebsd.org> <20070409024826.553be564@dev.lan.Awfulhak.org> <20070410010510.GB61460@wantadilla.lemis.com> <20070409.222011.1689682576.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--OgApRN/oydYDdnYz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Monday,  9 April 2007 at 22:20:11 -0600, M. Warner Losh wrote:
> In message: <20070410010510.GB61460@wantadilla.lemis.com>
>             "Greg 'groggy' Lehey" <grog@freebsd.org> writes:
>> On Monday,  9 April 2007 at  2:48:26 -0700, Brian Somers wrote:
>>> I don't understand what this means.  File times are in UTC aren't
>>> they?
>>
>> No, they're in time_t.  But if you import files from other systems,
>> you frequently get times which are off by some time zone offset.
>
> time_t is UTC, by definition (sadly, POSIX has enshrined a broken
> definition of UTC as the time_t definition, but that's not important
> right now).

The definition of time_t is simply a number of seconds since a
specified event.  It's true that this event was the turn of the
year/decade in UTC, but that doesn't make it UTC.  Currently my time_t
is 1176181168; that's not directly recognizable as any time zone.

> It cannot be a localtime.  Localtime conversion of time_t is done by
> libc to print the local time.

But libc also needs to convert time_t to UTC.

>> The case in point is that when importing files from digital cameras
>
> FAT doesn't deal in time_t.  It deals in 'local time' only, encoded in
> a funky way.

Right.  And that's the largest part of the problem.

> The rest of what you say is correct, but since there is much confusion
> around time_t I thought I'd be pedantic.

Nothing wrong with being pedantic :-)

Greg
--
See complete headers for address and phone numbers.

--OgApRN/oydYDdnYz
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQFGGxnbIubykFB6QiMRAp0tAJ90aHZyXkVBt5D3CIYk79UG1V8IxgCgj3zK
RU2Q4Qa0R2XTJuZj6pnYyJ0=
=eWtb
-----END PGP SIGNATURE-----

--OgApRN/oydYDdnYz--



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