home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / DATETIME.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  1KB  |  58 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*
  4. **  Header for SNIPPETS date & time function, excluding scalar dates
  5. */
  6.  
  7. #ifndef DATETIME__H
  8. #define DATETIME__H
  9.  
  10. #include "sniptype.h"
  11.  
  12. /*
  13. **  Julian day number functions from JDN_L.C
  14. */
  15.  
  16. long ymd_to_jdnl(int y, int m, int d, int julian);
  17. void jdnl_to_ymd(long jdn, int *yy, int *mm, int *dd, int julian);
  18.  
  19. /*
  20. **  Add times from ADDTIME.C
  21. */
  22.  
  23. int add_time(unsigned basehrs, unsigned basemins, unsigned basesecs,
  24.              int spanhrs, int spanmins, int spansecs,
  25.              unsigned *hrs, unsigned *mins, unsigned *secs, int *days);
  26.  
  27. /*
  28. **  Determine the date of Easter for any given year
  29. */
  30.  
  31. void easter(int year, int *easter_month, int *easter_day);
  32.  
  33.  
  34. /*
  35. **  Moon phase from MOON_AGE.C
  36. */
  37.  
  38. int moon_age(int month, int day, int year);
  39.  
  40. /*
  41. **  Date parser from PARSDATE.C
  42. */
  43.  
  44. typedef enum {USA, ISO, EUROPE} Syntax_T;
  45.  
  46. Boolean_T parse_date(const char *str, unsigned *year, unsigned *month,
  47.                      unsigned *day, Syntax_T syntax);
  48.  
  49. /*
  50. **  Time parser from PARSTIME.C
  51. */
  52.  
  53. Boolean_T parse_time(const char *str, unsigned *hours, unsigned *mins,
  54.                      unsigned *secs);
  55.  
  56.  
  57. #endif /* DATETIME__H */
  58.