def getUtcOffsetByJd(jd, tz=None): y, m, d = jd_to_g(jd) return getUtcOffsetByDateSec(y, m, d, tz)
def epochGregDateTimeEncode(epoch, tz=None): jd, hour, minute, second = getJhmsFromEpoch(epoch, tz) year, month, day = jd_to_g(jd) return '%.4d/%.2d/%.2d %.2d:%.2d:%.2d'%(year, month, day, hour, minute, second)
def getEpochFromJd(jd, tz=None): localEpoch = (jd-J1970) * 24*3600 year, month, day = jd_to_g(jd-1) ## FIXME return localEpoch - getUtcOffsetByDateSec(year, month, day, tz)
def getUtcOffsetByJd(jd, tz=None): y, m, d = jd_to_g(jd) return getUtcOffsetByGDate(y, m, d, tz)
def epochGregDateTimeEncode(epoch, tz=None): jd, hour, minute, second = getJhmsFromEpoch(epoch, tz) year, month, day = jd_to_g(jd) return '%.4d/%.2d/%.2d %.2d:%.2d:%.2d' % (year, month, day, hour, minute, second)
def getEpochFromJd(jd, tz=None): localEpoch = (jd - J1970) * 24 * 3600 year, month, day = jd_to_g(jd) ## jd or jd-1? FIXME return localEpoch - getUtcOffsetByGDate(year, month, day, tz)