Back to index

courier  0.68.2
rfc1035fmttime.c File Reference
#include "rfc1035.h"
#include <string.h>

Go to the source code of this file.


const char * rfc1035_fmttime (unsigned long n, char *buf)

Function Documentation

const char* rfc1035_fmttime ( unsigned long  n,
char *  buf 

Definition at line 10 of file rfc1035fmttime.c.

unsigned long s,m,h;

       s = n % 60; n=n/60;
       m = n % 60; n=n/60;
       h = n % 24; n=n/24;

       if (n) sprintf(buf,"%lud",n);
       if (n || h)   sprintf(buf+strlen(buf), "%luh", h);
       if (n || h || m)     sprintf(buf+strlen(buf), "%lum", m);
       sprintf(buf+strlen(buf), "%lus", s);
       return (buf);

Here is the caller graph for this function: