From: av556@detroit.freenet.org (Kenneth M. Howlett)
To: linux-kernel@vger.kernel.org, mnalis-umsdos@voyager.hr,
chaffee@cs.berkeley.edu, bsg@uniyar.ac.ru
Subject: PROBLEM: dos filesystem timestamps and daylight savings time
Date: Tue, 29 Oct 2002 20:08:20 -0500 (EST) [thread overview]
Message-ID: <200210300108.UAA17536@detroit.freenet.org> (raw)
A few days ago, daylight savings time ended, and now
ls --full-time says the timestamps of all the files on
my dos partition have increased by one hour.
For example, ls --full-time says the timestamp of command.com is:
last week: Tue Apr 07 06:00:00 1992
this week: Tue Apr 07 07:00:00 1992
I think the timestamps of a dos filesystem are stored in local
time. So the dos filesystem driver needs to convert the local
time to unix standard time, and then ls converts back to local
time, and displays the timestamp in local time.
I think that the problem is that the dos filesystem driver's
local time to unix standard time algorithm is compensating for
whether or not daylight savings time is in effect NOW. It should
be compensating for whether or not daylight savings time was in
effect at the time of the timestamp.
The time conversion algorithm is function date_dos2unix in file
/usr/src/linux-2.4.19/fs/fat/misc.c. Is there a way to use
tz_minuteswest from the the time of the timestamp instead of the
current tz_minuteswest?
Or before returning the number of seconds, function date_dos2unix
could determine if daylight savings time is in effect now, and if
daylight savings time was in effect at the time of the timestamp.
These determinations could return 0 or 1. Then subtract the two
determinations, which will give us -1, 0, or 1. Multiply by 3600
and add to the number of seconds.
Function fat_date_unix2dos in file
/usr/src/linux-2.4.19/fs/fat/misc.c should have a similar fix.
ls appears to convert unix standard time to local time correctly,
adjusting for whether or not daylight savings time was in effect
at the time being converted. Maybe we should look at the source
for ls, to see how ls converts time.
I am running redhat 7.2 on a pcchips741lmrt/pentiumII, with a
custom 2.4.19 kernel, compiled with gcc version 2.96. My dos
partition is plain dos, not vfat or umsdos.
next reply other threads:[~2002-10-30 1:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-30 1:08 Kenneth M. Howlett [this message]
2002-10-30 8:23 ` PROBLEM: dos filesystem timestamps and daylight savings time Jan Hudec
2002-10-30 16:34 ` Chris Wedgwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200210300108.UAA17536@detroit.freenet.org \
--to=av556@detroit.freenet.org \
--cc=bsg@uniyar.ac.ru \
--cc=chaffee@cs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=mnalis-umsdos@voyager.hr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox