pub fn from_packed_u64(u: u64, time_type: TimeType, fsp: i8, tz: &Tz) -> Result<Time> {
        if u == 0 {
            return Time::new(zero_time(tz), time_type, fsp);
        }
        let fsp = mysql::check_fsp(fsp)?;
        let ymdhms = u >> 24;
        let ymd = ymdhms >> 17;
        let day = (ymd & ((1 << 5) - 1)) as u32;
        let ym = ymd >> 5;
        let month = (ym % 13) as u32;
        let year = (ym / 13) as i32;
        let hms = ymdhms & ((1 << 17) - 1);
        let second = (hms & ((1 << 6) - 1)) as u32;
        let minute = ((hms >> 6) & ((1 << 6) - 1)) as u32;
        let hour = (hms >> 12) as u32;
        let nanosec = ((u & ((1 << 24) - 1)) * 1000) as u32;
        let t = if time_type == TimeType::Timestamp {
            let t = ymd_hms_nanos(&Utc, year, month, day, hour, minute, second, nanosec)?;
            tz.from_utc_datetime(&t.naive_utc())
        } else {
            ymd_hms_nanos(tz, year, month, day, hour, minute, second, nanosec)?
        };
        Time::new(t, time_type, fsp as i8)
    }
/// Get time from packed u64. When `tp` is `TIMESTAMP`, the packed time should
/// be a UTC time; otherwise the packed time should be in the same timezone as `tz`
/// specified.
Get time from packed u64.
Get time from packed u64 .
pub fn from_packed_u64(u: u64, time_type: TimeType, fsp: i8, tz: &Tz) -> Result<Time> {
        if u == 0 {
            return Time::new(zero_time(tz), time_type, fsp);
        }
        let fsp = mysql::check_fsp(fsp)?;
        let ymdhms = u >> 24;
        let ymd = ymdhms >> 17;
        let day = (ymd & ((1 << 5) - 1)) as u32;
        let ym = ymd >> 5;
        let month = (ym % 13) as u32;
        let year = (ym / 13) as i32;
        let hms = ymdhms & ((1 << 17) - 1);
        let second = (hms & ((1 << 6) - 1)) as u32;
        let minute = ((hms >> 6) & ((1 << 6) - 1)) as u32;
        let hour = (hms >> 12) as u32;
        let nanosec = ((u & ((1 << 24) - 1)) * 1000) as u32;
        let t = if time_type == TimeType::Timestamp {
            let t = ymd_hms_nanos(&Utc, year, month, day, hour, minute, second, nanosec)?;
            tz.from_utc_datetime(&t.naive_utc())
        } else {
            ymd_hms_nanos(tz, year, month, day, hour, minute, second, nanosec)?
        };
        Time::new(t, time_type, fsp as i8)
    }
pub fn from_packed_u64 ( u : u64 , time_type : TimeType , fsp : i8 , tz : & Tz ) -> Result < Time > { if u == 0 { return Time :: new ( zero_time ( tz ) , time_type , fsp ) ; } let fsp = mysql :: check_fsp ( fsp ) ? ; let ymdhms = u >> 24 ; let ymd = ymdhms >> 17 ; let day = ( ymd & ( ( 1 << 5 ) - 1 ) ) as u32 ; let ym = ymd >> 5 ; let month = ( ym % 13 ) as u32 ; let year = ( ym / 13 ) as i32 ; let hms = ymdhms & ( ( 1 << 17 ) - 1 ) ; let second = ( hms & ( ( 1 << 6 ) - 1 ) ) as u32 ; let minute = ( ( hms >> 6 ) & ( ( 1 << 6 ) - 1 ) ) as u32 ; let hour = ( hms >> 12 ) as u32 ; let nanosec = ( ( u & ( ( 1 << 24 ) - 1 ) ) * 1000 ) as u32 ; let t = if time_type == TimeType :: Timestamp { let t = ymd_hms_nanos ( & Utc , year , month , day , hour , minute , second , nanosec ) ? ; tz . from_utc_datetime ( & t . naive_utc ( ) ) } else { ymd_hms_nanos ( tz , year , month , day , hour , minute , second , nanosec ) ? } ; Time :: new ( t , time_type , fsp as i8 ) }
Get time from packed u64.
Get time from packed u64 .
u
u64
time_type
TimeType
fsp
i8
tz
&Tz
u
u64
time_type
TimeType
fsp
i8
tz
&Tz