Example #1
0
def getUtcOffsetByJd(jd, tz=None):
    y, m, d = jd_to_g(jd)
    return getUtcOffsetByDateSec(y, m, d, tz)
Example #2
0
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)
Example #3
0
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)
Example #4
0
def getUtcOffsetByJd(jd, tz=None):
    y, m, d = jd_to_g(jd)
    return getUtcOffsetByGDate(y, m, d, tz)
Example #5
0
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)
Example #6
0
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)