'Test time formats derived from EpochFromTime'

def test_epoch_times(self):

    t = Time(0.0, format='cxcsec', scale='tai')
    assert (t.tt.iso == '1998-01-01    00:00:00.000')
    t2 = Time(t, scale='tt', format='iso')
    assert (t2.value == '1998-01-01    00:00:00.000')
    t_cxcsec = 378691266.184
    t = Time(t_cxcsec, format='cxcsec', scale='utc')
    assert allclose_sec(t.value, t_cxcsec)
    assert allclose_sec(t.cxcsec, t_cxcsec)
    assert allclose_sec(t.tt.value, t_cxcsec)
    assert allclose_sec(t.tt.cxcsec, t_cxcsec)
    assert (t.yday == '2010:001:00:00:00.000')
    t = Time('2010:001:00:00:00.000', scale='utc')
    assert allclose_sec(t.cxcsec, t_cxcsec)
    assert allclose_sec(t.tt.cxcsec, t_cxcsec)
    t = Time('2000-01-01    00:00:00', scale='utc')
    assert np.allclose(t.plot_date, 730120.0, atol=1e-05, rtol=0)
    for scale in ('utc', 'tt'):
        t = Time('2000:001', scale=scale)
        t2 = Time(t.unix, scale=scale, format='unix')
        assert (getattr(t2, scale).iso == '2000-01-01    00:00:00.000')
    t = Time('2013-05-20    21:18:46', scale='utc')
    assert allclose_sec(t.unix, 1369084726.0)
    assert allclose_sec(t.tt.unix, 1369084726.0)
    t = Time('2004-09-16T23:59:59', scale='utc')
    assert allclose_sec(t.unix, 1095379199.0)
