home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / j / julian11.zip / DATEDIFF.C < prev    next >
Text File  |  1993-01-11  |  562b  |  20 lines

  1. #include "julian.h"
  2.  
  3. // ===== D A T E _ D I F F
  4. // Takes two dates and determines the number of days difference between them
  5. //
  6. // date1_stp   - The date to be subtracted
  7. // date2_stp   - The date to be subtracted from
  8. // format_stp  - The date format (must be same as both date1_stp and 
  9. //               date2_stp)
  10. //
  11. time_t date_diff(char *date1_stp, char *date2_stp, char *format_stp)
  12. {
  13.   time_t time1, time2;
  14.  
  15.   time1 = date_to_jul(date1_stp,format_stp);
  16.   time2 = date_to_jul(date2_stp,format_stp);
  17.  
  18.   return((time2-time1)/DAY_SECS);
  19. }
  20.