Date: Mon, 09 Apr 2007 22:20:11 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: grog@freebsd.org 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: <20070409.222011.1689682576.imp@bsdimp.com> In-Reply-To: <20070410010510.GB61460@wantadilla.lemis.com> References: <20070409021942.C150B16A529@hub.freebsd.org> <20070409024826.553be564@dev.lan.Awfulhak.org> <20070410010510.GB61460@wantadilla.lemis.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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:
: > On Mon, 9 Apr 2007 02:19:42 +0000 (UTC) Greg Lehey <grog@FreeBSD.ORG> wrote:
: >> grog 2007-04-09 02:19:37 UTC
: >>
: >> FreeBSD src repository
: >>
: >> Modified files:
: >> usr.bin/touch touch.1 touch.c
: >> Log:
: >> Add -A flag to adjust existing time stamps.
: >> diff -u src/usr.bin/touch/touch.1:1.14 src/usr.bin/touch/touch.1:1.15
: >> --- src/usr.bin/touch/touch.1:1.14 Sun Feb 13 22:25:24 2005
: >> +++ src/usr.bin/touch/touch.1 Mon Apr 9 02:19:37 2007
: >> +.It Fl A
: >> +Adjust the access and modification time stamps for the file by the
: >> +specified value.
: >> +This flag is intended for use in modifying files with a time stamp
: >> +relative to an incorrect time zone.
: >
: > 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). It cannot be a localtime. Localtime conversion of time_t
is done by libc to print the local time.
: The case in point is that when importing files from digital cameras,
: it's frequently impossible to get the correct time. Many cameras are
: too stupid to handle time zones at all and assume it's UTC. Those
: that can make a typically US assumption that all time zones are on the
: hour. Here in South Australia, for example, we have a time zone
: offset of +0930, which seems to blow the minds of most cameras. In my
: case, I have a Canon that fits the first category, and a Nikon that
: fits the second.
FAT doesn't deal in time_t. It deals in 'local time' only, encoded in
a funky way.
The rest of what you say is correct, but since there is much confusion
around time_t I thought I'd be pedantic.
Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070409.222011.1689682576.imp>
