add flexibility to getOffsetFromTime in terms of formats accepted