Functions for handling dates.

gd2jd – converts gregorian date to julian date jd2gd – converts julian date to gregorian date
Wish list:
Function to convert heliocentric julian date!

These functions were taken from Enno Middleberg’s site of useful astronomical python references:

“Feel free to download, use, modify and pass on these scripts, but please do not remove my name from it.” –E. Middleberg

date.gd2jd(*date)[source] converts a UT Gregorian date to Julian date.

Usage: (2009, 02, 25, 01, 59, 59)

To get the current Julian date:
import time gd2jd(time.gmtime())

Hours, minutes and/or seconds can be omitted – if so, they are assumed to be zero.

Year and month are converted to type INT, but all others can be type FLOAT (standard practice would suggest only the final element of the date should be float)


Task to convert a list of julian dates to gregorian dates description at Original algorithm in Jean Meeus, “Astronomical Formulae for Calculators”

2009-02-15 13:36 IJC: Converted to importable, callable function

Previous topic

GUI routines

Next topic

Web stuff

This Page