Wednesday, July 30, 2008

Julian Day in Python

I found very little documentation on obtaining the Juilian day with the time module in Python. So this is how it's done:
import time

print time.strftime("%j")

As easy as that!


Unknown said...

I've since realized that the Julian day is actually a different format, and the day referred to in this article is the ordinal date (

Willem said...

You should have asked me ;-)

import datetime
datetime.datetime.timetuple () [7]