File datefns.icn

Summary

###########################################################################

	File:     datefns.icn

	Subject:  Procedure for dates

	Author:   Charles Hethcoat

	Date:     August 14, 1995

###########################################################################

   This file is in the public domain.

###########################################################################

 datefns.icn - a collection of date functions

 Adaptor:  Charles L Hethcoat III
 June 12, 1995
 Taken from various sources as attributed below.
 
 All date and calendar functions use the "date_rec" structure defined
 below.

 Note:  I adapted the procedures "julian" and "unjulian" sometime in 1994
 from "Numerical Recipes in C."  Some time later I discovered them
 (under slightly different names) in Version 9 of the Icon Library
 (Ralph Griswold, author).  I am including mine for what they are worth.
 That'll teach me to wait!

###########################################################################
Procedures:
doy, initdate, julian, today, unjulian, wrdate

Records:
date_rec

Global variables:
cum_days, dow, monthlist, monthtbl

This file is part of the (main) package.

Source code.

Details
Procedures:

doy(year, month, day)

 doy - return day-of-year from (year, month, day)
 Adapted from K&R


initdate()


julian(date)

 julian - convert a date_rec to a Julian day number


today()

 today - obtain computationally-useful values for today's date


unjulian(julianday)

 unjulian - produce a date from the Julian day number


wrdate(leadin, date)

 wrdate - write out a basic date string with a leadin string


Records:

date_rec(year, month, day, yearday, monthname, dayname)


Global variables:
cum_days -- Cum. day counts for month end, leap & non-leap yrs.

dow -- Maps 1-7 into Sunday-Saturday

monthlist -- Maps month numbers into month names

monthtbl -- Maps month names into numbers 1-12


This page produced by UniDoc on 2021/04/15 @ 23:59:54.