Date/time

Contents:

Functions for handling dates.

Contains:
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: http://www.astro.rub.de/middelberg/python/python.html

“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]

gd2jd.py converts a UT Gregorian date to Julian date.

Usage: gd2jd.py (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)

date.jd2gd(jd)[source]

Task to convert a list of julian dates to gregorian dates description at http://mathforum.org/library/drmath/view/51907.html 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