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

  1. #include "julian.h"
  2.  
  3. // ===== D A T E _ P L U S
  4. // Takes a date and adds or subtracts a number of days from it and returns
  5. // a new date in the same format.
  6. //
  7. // dateret_stp - the date string returned
  8. // date_stp    - the date to added/subtracted to/from
  9. // format_stp  - The date (must be same as date_stp and will be the format
  10. //               of dateret_stp
  11. // days        - the days to add/subtract
  12. //
  13. int date_plus(char *dateret_stp,char *date_stp,char *format_stp,time_t days)
  14. {
  15.   time_t tosecs;
  16.  
  17.   tosecs = date_to_jul(date_stp,format_stp);
  18.   tosecs+=(days*DAY_SECS);
  19.   date_fm_jul(dateret_stp,tosecs,format_stp);
  20. }
  21.