info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wincvs and cvs problem after daylight savings time change??


From: Jonathan H Lundquist
Subject: Re: Wincvs and cvs problem after daylight savings time change??
Date: Tue, 30 Oct 2001 16:09:32 -0800

Yes, the way Windows handles file dates is weird, but it's CVS that needs to
be fixed!  The timestamp written to the entries file is supposedly UTC, for
any given 'real' time, this should be the same whether it is currently DST
or not, unfortunately such is not the case.  Determining if a timestamp
falls within DST is fairly simple:

namespace {

bool btz;
TIME_ZONE_INFORMATION tz;

}  // namespace anonymous

bool IsDaylightTime(unsigned __int64 timestamp)
{
   if ( !btz ) {
      btz = true;
      GetTimeZoneInformation(&tz);
   }
   CASSERT(sizeof(FILETIME) == sizeof(unsigned __int64));
   SYSTEMTIME stStamp;
   FileTimeToSystemTime((FILETIME*)&timestamp, &stStamp);
   SYSTEMTIME lstStamp;
   SystemTimeToTzSpecificLocalTime(&tz, &stStamp, &lstStamp);
   FILETIME ftStamp;
   SystemTimeToFileTime(&stStamp, &ftStamp);
   FILETIME lftStamp;
   SystemTimeToFileTime(&lstStamp, &lftStamp);
   unsigned __int64& utcstamp = *(unsigned __int64*)&ftStamp;
   unsigned __int64& localstamp = *(unsigned __int64*)&lftStamp;
   int minutes = (int)(__int64(utcstamp - localstamp) / 10000000 / 60);
   if ( minutes == tz.Bias + tz.DaylightBias )
      return true;
   return false;
}

I don't know how to go about getting the required changes integrated into
CVS though.

"Jerry Nairn" <address@hidden> wrote in message
news:address@hidden
> There was a little discussion here, and a lot on the cvsgui mailing list
> earlier this year, the last time we had a DST transition. The problem
arises
> from the weird way Windows handles file dates, ...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]