Next / Previous / Contents / Shipman's homepage

9.7. JulianDate.fromDatetime(): Convert a datetime

Use this static method to convert a standard Python datetime instance into a JulianDate instance.

JulianDate.fromDatetime(dt)

The dt argument is a datetime instance. If dt contains time zone information, the returned JulianDate instance will represent the corresponding UTC. If dt is “naive”, containing no time zone information, it is assumed to represent UTC.