Date: Sun, 6 May 2001 09:21:42 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Rafal Maj cc: djgpp AT delorie DOT com Subject: Re: Date in seconds In-Reply-To: <9d1mlr$i8j$1@info.cyf-kr.edu.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 5 May 2001, Rafal Maj wrote: > Is there some function that will represent time in seconds ? Yes, it's called `time', and you already found it. > If I remember > correct, ther was some functions return date as seconds after 1972.??.?? or > something like that. `time' returns the amount of seconds since 00:00:00 GMT on Jan 1, 1970. > I have found function time()... but I have problems with it: > printf("Time is %d\n", time(0)); > This won't compile in C++ and will in C. Why ? How to compile in C++ ? What were the compiler error messages? Did you include ? Also note that `time' returns a time_t object, so C++ might object to printing it with a %d. Try %u instead.