On 2004-08-10 18:45, Mipam <[EMAIL PROTECTED]> wrote:
> #include <stdio.h>
> #include <sys/time.h>
>
> int main(void)
> {
> struct timeval tv;
> struct timeval tv_current;
> if (gettimeofday(&tv_current, NULL) == -1)
>    err(1, "Could not get local time of day");
> tv.tv_sec = tv_current.tv_sec-86400;
> printf("%s\n", ctime(&tv.tv_sec));
> return 0;
> }

Hmmm, now that I noticed.  You don't need to add a trailing '\n' to the
string of ctime().  It already has one:

        [EMAIL PROTECTED]:11]/home/keramida$ ./a.out
        Mon Aug  9 20:11:30 2004

        [EMAIL PROTECTED]:11]/home/keramida$

Bye

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to