
README information for jday and j2d		VERSION 1.3 2002-11-11

Astronomical Julian Date calculator

See also:  http://jday.sourceforge.net/

To unpack the source archive:
	with gnu tar:  tar -xvzf jday-1.3.tar.gz
	or an ordinary tar:
	gunzip -c jday-1.3.tar.gz | tar -xvf -

This creates a ./jday-1.3 directory.

To build jday:

	cd jday-1.3
	./configure		(the usual configure arguments are honored)
	make

To install the jday, j2d and dbd binaries into /usr/local

	make install

Installs three binaries in /usr/local/bin:
	/usr/local/bin/jday
	/usr/local/bin/j2d
	/usr/local/bin/dbd
the include file:
	/usr/local/include/jday.h
the library:
	/usr/local/lib/libjday.a
and a man page:
	/usr/local/man/man1/jday.

To override the default /usr/local prefix,
use the --prefix=<some other prefix>
argument to the ./configure
(configure will honor the usual arguments)

TESTING:
	After the jday and j2d binaries are built, run the
	shell script: RunTest to test both of those binaries.

	The PERL examples can be tested with JdayTest.pl

	The dbd - days between dates example can be tested with Testdbd

To use:		(see also: jday.html in the source directory)

jday - with no arguments will print out the current Julian date
	based on your system clock and timezone.  If your
	timezone or system clock are inaccurate, the output of
	jday will also be inaccurate

To compute the Julian Date of a particular date/time,
any of the following invocations are allowed::

	jday year
	jday year month
	jday year month day
	jday year month day hour
	jday year month day hour minute
	jday year month day hour minute second

For those items not specified, the current system date/time is used.
And for symmetry with j2d output, the format of the output
of j2d can be used:

	jday -d year/month/day hour:minute:second

and in this case all items must be specified.

j2d only operates in one mode.

j2d - must have an argument, which is a julian date.
Output will be in the form: year/month/day hour:minute:second

For example, the following is possible::

	j2d `jday`

There is a RunTest script which will run through the following
set of dates.  Watch for any FAIL indications.

Examples:		(note: there is a year zero in julian dates)

	$ jday -4712 1 1 12 0 0
	0.000000         
	$ j2d 0.0
	-4712/01/01 12:00:00
	$ jday -1 12 31 12 0 0
	1721057.000000   
	$ j2d 1721057.000000
	-1/12/31 12:00:00
	$ j2d 1721058.000000
	0/01/01 12:00:00
	$ jday -d 0/01/01 12:00:00
	1721058.000000
	$ jday 0 12 31 12 0 0
	1721423.000000   
	$ jday 1 1 1 12 0 0
	1721424.000000   

	$ jday 1970 1 1 0 0 0
	2440587.500000   
	$ j2d 2440587.500000
	1970/01/01 00:00:00

	$ j2d 2451774.726007
	2000/08/18 05:25:27
	$ jday -d 2000/08/18 05:25:27
	2451774.726007

NEW TO VERSION 1.3:

There are now versions written in AWK, PHP and PERL.
They are not installed from the source directory.
PERL source:  CalDate.pm  J2D.pl  Jday.pl  JdayTest.pl
PHP source: CalDate.inc  Jday.php
AWK source: dbd.awk jday.awk
	(these AWK sources are shell scripts with the awk code
		in them.)

A demonstration program is included:  dbd.c (and dbd.awk)
	which will calculate days between dates.
	Testdbd script will exercise this example.

KNOWN BUGS:

I haven't tested the awk version very much and it is not complete
with a j2d.awk function.  Also since awk isn't uniform on all systems,
it may not function.

I'm getting some errors on Alpha linux:

./jday -d -4712/01/01 12:00:00 -> 1568704592647.000000 - FAIL
./jday -d -1/12/31 12:00:00 -> 1568706313669.000000 - FAIL

This is most likely a problem in the scanf input of the
arguments on the command line since the same date input without
the -d argument works OK.

The 64 bit environment needs to be checked.

DEVELOPMENT ENVIRONMENT:

GNU Tools version used to generate the configure files:

automake (GNU automake) 1.6.1
aclocal (GNU automake) 1.6.1
autoconf (GNU Autoconf) 2.53
libtoolize (GNU libtool) 1.4.2

SEE ALSO:

Time Standard: http://tycho.usno.navy.mil
Systems of time:  http://tycho.usno.navy.mil/systime.html

	curator@hiram.ws - 2002/11/11 11:11:11 UTC - JD 2452589.966100
