[BACK]Return to date.y CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/date.y between version 1.9 and 1.10

version 1.9, 2005/09/25 19:11:34 version 1.10, 2005/10/07 21:47:32
Line 537 
Line 537 
                         Hours = 0;                          Hours = 0;
                 return ((Hours + 12) * 60L + Minutes) * 60L + Seconds;                  return ((Hours + 12) * 60L + Minutes) * 60L + Seconds;
         default:          default:
                 abort ();                  abort();
         }          }
         /* NOTREACHED */          /* NOTREACHED */
 }  }
Line 802 
Line 802 
         int ay = a->tm_year + (YEAR_TMORIGIN - 1);          int ay = a->tm_year + (YEAR_TMORIGIN - 1);
         int by = b->tm_year + (YEAR_TMORIGIN - 1);          int by = b->tm_year + (YEAR_TMORIGIN - 1);
         int days = (          int days = (
                           /* difference in day of year */              /* difference in day of year */
                           a->tm_yday - b->tm_yday              a->tm_yday - b->tm_yday
                           /* + intervening leap days */              /* + intervening leap days */
                           +  ((ay >> 2) - (by >> 2))              +  ((ay >> 2) - (by >> 2))
                           -  (ay/100 - by/100)              -  (ay/100 - by/100)
                           +  ((ay/100 >> 2) - (by/100 >> 2))              +  ((ay/100 >> 2) - (by/100 >> 2))
                           /* + difference in years * 365 */              /* + difference in years * 365 */
                           +  (long)(ay-by) * 365              +  (long)(ay-by) * 365);
                           );  
         return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))          return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
             + (a->tm_min - b->tm_min)) + (a->tm_sec - b->tm_sec));              + (a->tm_min - b->tm_min)) + (a->tm_sec - b->tm_sec));
 }  }
Line 852 
Line 851 
                 if (gmt_ptr != NULL)                  if (gmt_ptr != NULL)
                         ftz.timezone = difftm(&gmt, tm) / 60;                          ftz.timezone = difftm(&gmt, tm) / 60;
   
                 if(tm->tm_isdst)                  if (tm->tm_isdst)
                         ftz.timezone += 60;                          ftz.timezone += 60;
         }          }
         else {          else {
Line 889 
Line 888 
         } else {          } else {
                 Start = nowtime;                  Start = nowtime;
                 if (!yyHaveRel)                  if (!yyHaveRel)
                         Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec;                          Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) +
                               tm->tm_sec;
         }          }
   
         Start += yyRelSeconds;          Start += yyRelSeconds;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10