I’m trying to get a timestamp reported by my linux computer into UT1. My understanding is that for this distribution calling python’s time.time() gives me the unix time (the number of seconds ignoring leap seconds since the UTC epoch). I want to take this time and convert it to UT1. I see two ways to do this with astropy but it’s not clear to me which is correct as they seem to give different results.
Option 1
import time
from astropy.time import Time
unix_time = Time(time.time(), format='unix', scale='utc')
ut1_time = unix_time.ut1
Option 2
import time
from astropy.time import Time
unix_time = Time(time.time(), format='unix', scale='utc')
ut1_time = unix_time + unix_time.get_delta_ut1_utc()
Looking up UTC to UT1 conversions online implies Option 2 would be the normal approach. But that seems to assume the UTC implementation accounts for leap seconds which I believe is not the case here. Is that the reason these are giving me different results? I’m fairly new to UT1 so I may be missing some understanding.