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" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> 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, ...


_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to