Lines Matching refs:sec
450 ** touch (name, sec)
452 ** 'sec'. Returns 0 on success.
454 int touch (const char *fname, time_t sec)
458 utb.actime = utb.modtime = sec;
785 time_t sec;
797 sec = timegm (&t);
807 sec = mktime(&t);
817 return sec < 0L ? 0L : sec;
821 ** time2str (sec, precison)
822 ** sec is seconds since 1.1.1970
825 char *time2str (time_t sec, int precision)
833 if ( sec <= 0L )
835 t = localtime (&sec);
852 if ( sec <= 0L )
854 t = localtime (&sec);
891 ** time2isostr (sec, precison)
892 ** sec is seconds since 1.1.1970
895 char *time2isostr (time_t sec, int precision)
901 if ( sec <= 0L )
904 t = gmtime (&sec);
918 ** age2str (sec)
921 char *age2str (time_t sec)
929 if ( sec / (YEARSEC) > 0 )
931 len += snprintf (str+len, strsize - len, "%1luy", sec / YEARSEC );
932 sec %= (YEARSEC);
937 if ( sec / WEEKSEC > 0 )
939 len += snprintf (str+len, strsize - len, "%2luw", (ulong) sec / WEEKSEC );
940 sec %= WEEKSEC;
944 if ( sec / DAYSEC > 0 )
946 len += snprintf (str+len, strsize - len, "%2lud", sec / (ulong)DAYSEC);
947 sec %= DAYSEC;
951 if ( sec / HOURSEC > 0 )
953 len += snprintf (str+len, strsize - len, "%2luh", sec / (ulong)HOURSEC);
954 sec %= HOURSEC;
958 if ( sec / MINSEC > 0 )
960 len += snprintf (str+len, strsize - len, "%2lum", sec / (ulong)MINSEC);
961 sec %= MINSEC;
965 if ( sec > 0 )
966 snprintf (str+len, strsize - len, "%2lus", (ulong) sec);