pub fn new_from_epoch(since_epoch: uint) -> GCalendar {
        let epoch_year = 1970;
        let mut year = epoch_year;

        let millisecs_day = 86400000;

        let mut dayclock = since_epoch % millisecs_day;
        let mut dayno = since_epoch / millisecs_day;

        let hour = dayclock / 3600000;
        dayclock = dayclock - (hour * 3600000);
        let min = dayclock / 60000;
        dayclock = dayclock - (min * 60000);
        let sec = dayclock / 1000;
        let wday = (dayno + 4) % 7;

        while (dayno >= year_size(year)) {
            dayno -= year_size(year);
            year += 1;
        }
        let yday = dayno;

        let ip = DAYSBEFOREMONTH[if is_leap_year(year) {1} else {0}];
        let mut month = 11;
        while (dayno < ip[month]) {
            month -= 1;
        }
        dayno -= ip[month];

        GCalendar {
            sec: sec,
            min: min,
            hour: hour,
            mday: dayno + 1,
            month: month  + 1,
            year: year,
            wday: wday,
            yday: yday,
        }
    }
/**
    * Allocates a GCalendar object from the milliseconds elapsed since epoch.
    */
Allocates a GCalendar object from the milliseconds elapsed since epoch.
Allocates a GCalendar object from the milliseconds elapsed since epoch .
pub fn new_from_epoch(since_epoch: uint) -> GCalendar {
        let epoch_year = 1970;
        let mut year = epoch_year;
        let millisecs_day = 86400000;
        let mut dayclock = since_epoch % millisecs_day;
        let mut dayno = since_epoch / millisecs_day;
        let hour = dayclock / 3600000;
        dayclock = dayclock - (hour * 3600000);
        let min = dayclock / 60000;
        dayclock = dayclock - (min * 60000);
        let sec = dayclock / 1000;
        let wday = (dayno + 4) % 7;
        while (dayno >= year_size(year)) {
            dayno -= year_size(year);
            year += 1;
        }
        let yday = dayno;
        let ip = DAYSBEFOREMONTH[if is_leap_year(year) {1} else {0}];
        let mut month = 11;
        while (dayno < ip[month]) {
            month -= 1;
        }
        dayno -= ip[month];
        GCalendar {
            sec: sec,
            min: min,
            hour: hour,
            mday: dayno + 1,
            month: month  + 1,
            year: year,
            wday: wday,
            yday: yday,
        }
    }
pub fn new_from_epoch ( since_epoch : uint ) -> GCalendar { let epoch_year = 1970 ; let mut year = epoch_year ; let millisecs_day = 86400000 ; let mut dayclock = since_epoch % millisecs_day ; let mut dayno = since_epoch / millisecs_day ; let hour = dayclock / 3600000 ; dayclock = dayclock - ( hour * 3600000 ) ; let min = dayclock / 60000 ; dayclock = dayclock - ( min * 60000 ) ; let sec = dayclock / 1000 ; let wday = ( dayno + 4 ) % 7 ; while ( dayno >= year_size ( year ) ) { dayno -= year_size ( year ) ; year += 1 ; } let yday = dayno ; let ip = DAYSBEFOREMONTH [ if is_leap_year ( year ) { 1 } else { 0 } ] ; let mut month = 11 ; while ( dayno < ip [ month ] ) { month -= 1 ; } dayno -= ip [ month ] ; GCalendar { sec : sec , min : min , hour : hour , mday : dayno + 1 , month : month + 1 , year : year , wday : wday , yday : yday , } }
Allocates a GCalendar object from the milliseconds elapsed since epoch.
Allocates a GCalendar object from the milliseconds elapsed since epoch .
since_epoch
uint