home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / datetime / c_dates2 / separate / dow.c < prev    next >
Encoding:
Text File  |  1988-01-01  |  737 b   |  24 lines

  1. /************************************************************************/
  2. /*                *** dow.c ***                */
  3. /*                                    */
  4. /* This function returns the numerical day-of-week of a julian        */
  5. /* date, input as an unsigned long integer.                */
  6. /*                                    */
  7. /* The return value of the function is the day of the week expressed    */
  8. /* as an unsigned integer value, and is enumerated as follows:        */
  9. /*                                    */
  10. /*    Sunday    -  0                            */
  11. /*    Monday    -  1            Thursday  -  4            */
  12. /*    Tuesday   -  2            Friday    -  5            */
  13. /*    Wednesday -  3            Saturday  -  6            */
  14. /*                                    */
  15. /************************************************************************/
  16.  
  17. int dow( julian )
  18.  
  19. long julian;
  20.  
  21. {
  22.     return( (int)( ( julian + 5 ) % 7 ) );
  23. }
  24.