From owner-freebsd-questions@FreeBSD.ORG Tue Aug 10 14:49:27 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4926D16A4CE for ; Tue, 10 Aug 2004 14:49:27 +0000 (GMT) Received: from ux11.ltcm.net (ux11.ltcm.net [64.215.98.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E91843D2D for ; Tue, 10 Aug 2004 14:49:26 +0000 (GMT) (envelope-from mipam@ibb.net) Received: from ux11.ltcm.net (mipam@localhost.ltcm.net [IPv6:::1]) by ux11.ltcm.net (8.12.9/8.12.9/UX11TT) with ESMTP id i7AEnOIo028132 for ; Tue, 10 Aug 2004 16:49:25 +0200 (MEST) Received: from localhost (mipam@localhost) by ux11.ltcm.net (8.12.9/8.12.9/Submit) with ESMTP id i7AEnNQS009878 for ; Tue, 10 Aug 2004 16:49:23 +0200 (MEST) X-Authentication-Warning: ux11.ltcm.net: mipam owned process doing -bs Date: Tue, 10 Aug 2004 16:49:22 +0200 (MEST) From: Mipam X-X-Sender: mipam@ux11.ltcm.net To: freebsd-questions@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: localtime question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2004 14:49:27 -0000 Hi, I tried to display the time from yesterday by this little program #include #include time_t tval; int main() { 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) ); } But at compilation it complains: tijd.c: In function `main': tijd.c:15: warning: passing arg 1 of `ctime' makes pointer from integer without a cast What am i doing wrong? Bye, Mipam.