Using PyMeeus and the code below, you can get, for example, an answer
winter solstice for 2018 in Terrestrial Time is at: (2018, 12, 21, 22, 23, 52.493725419044495) winter solstice for 2018 in UTC, if last leap second was (2016, 12): (2018, 12, 21, 22, 22, 43.30972542127711) winter solstice for 2018 in local time, if last leap second was (2016, 12) and local time offset is -7.00 hours: (2018, 12, 21, 15, 22, 43.30973883232218) ie 2018-12-21T15:22:43.309725-07:00
Of course, the answer is not accurate accurate to microseconds, but I also wanted to show how to perform high-precision conversions with arrow .
The code:
from pymeeus.Sun import Sun from pymeeus.Epoch import Epoch year = 2018 target="winter" # Get terrestrial time of given solstice for given year solstice_epoch = Sun.get_equinox_solstice(year, target=target) print("%s solstice for %d in Terrestrial Time is at:\n %s" % (target, year, solstice_epoch.get_full_date())) print("%s solstice for %d in UTC, if last leap second was %s:\n %s" % (target, year, Epoch.get_last_leap_second()[:2], solstice_epoch.get_full_date(utc=True))) solstice_local = (solstice_epoch + Epoch.utc2local()/(24*60*60)) print("%s solstice for %d in local time, if last leap second was %s\n" " and local time offset is %.2f hours:\n %s" % (target, year, Epoch.get_last_leap_second()[:2], Epoch.utc2local() / 3600., solstice_local.get_full_date(utc=True)))
Using a very cool Arrow module with lots of ISO and TZ : the best dates and times for Python that you can print more beautifully:
import arrow import math slutc = solstice_epoch.get_full_date(utc=True) frac, whole = math.modf(slutc[5]) print("ie %s" % arrow.get(*slutc[:5], int(whole), round(frac * 1e6)).to('local'))