pub fn now() -> LocalTime {
        let mut timespec = libc::timespec {
            tv_sec: 0,
            tv_nsec: 0,
        };
        let mut tm: libc::tm = libc::tm {
            tm_sec: 0,
            tm_min: 0,
            tm_hour: 0,
            tm_mday: 0,
            tm_mon: 0,
            tm_year: 0,
            tm_wday: 0,
            tm_yday: 0,
            tm_isdst: 0,
            tm_gmtoff: 0,
            tm_zone: std::ptr::null(),
        };

        // Safe because the parameters are valid.
        unsafe {
            libc::clock_gettime(libc::CLOCK_REALTIME, &mut timespec);
            libc::localtime_r(&timespec.tv_sec, &mut tm);
        }

        LocalTime {
            sec: tm.tm_sec,
            min: tm.tm_min,
            hour: tm.tm_hour,
            mday: tm.tm_mday,
            mon: tm.tm_mon,
            year: tm.tm_year,
            nsec: timespec.tv_nsec,
        }
    }
/// Returns the [LocalTime](struct.LocalTime.html) structure for the calling moment.
Returns the [LocalTime](struct.LocalTime.html) structure for the calling moment.
Returns the [ LocalTime ] ( struct . LocalTime . html ) structure for the calling moment .
pub fn now() -> LocalTime {
        let mut timespec = libc::timespec {
            tv_sec: 0,
            tv_nsec: 0,
        };
        let mut tm: libc::tm = libc::tm {
            tm_sec: 0,
            tm_min: 0,
            tm_hour: 0,
            tm_mday: 0,
            tm_mon: 0,
            tm_year: 0,
            tm_wday: 0,
            tm_yday: 0,
            tm_isdst: 0,
            tm_gmtoff: 0,
            tm_zone: std::ptr::null(),
        };
        // Safe because the parameters are valid.
        unsafe {
            libc::clock_gettime(libc::CLOCK_REALTIME, &mut timespec);
            libc::localtime_r(&timespec.tv_sec, &mut tm);
        }
        LocalTime {
            sec: tm.tm_sec,
            min: tm.tm_min,
            hour: tm.tm_hour,
            mday: tm.tm_mday,
            mon: tm.tm_mon,
            year: tm.tm_year,
            nsec: timespec.tv_nsec,
        }
    }
pub fn now ( ) -> LocalTime { let mut timespec = libc :: timespec { tv_sec : 0 , tv_nsec : 0 , } ; let mut tm : libc :: tm = libc :: tm { tm_sec : 0 , tm_min : 0 , tm_hour : 0 , tm_mday : 0 , tm_mon : 0 , tm_year : 0 , tm_wday : 0 , tm_yday : 0 , tm_isdst : 0 , tm_gmtoff : 0 , tm_zone : std :: ptr :: null ( ) , } ; // Safe because the parameters are valid. unsafe { libc :: clock_gettime ( libc :: CLOCK_REALTIME , & mut timespec ) ; libc :: localtime_r ( & timespec . tv_sec , & mut tm ) ; } LocalTime { sec : tm . tm_sec , min : tm . tm_min , hour : tm . tm_hour , mday : tm . tm_mday , mon : tm . tm_mon , year : tm . tm_year , nsec : timespec . tv_nsec , } }
Returns the [LocalTime](struct.LocalTime.html) structure for the calling moment.
Returns the [ LocalTime ] ( struct . LocalTime . html ) structure for the calling moment .