From: Stephan Wilms Newsgroups: comp.os.msdos.djgpp,alt.comp.lang.learn.c-c++,comp.lang.c Subject: Re: Question(newbie): strptime alternative Date: Wed, 17 Nov 1999 18:37:18 +0100 Organization: CWA GmbH Lines: 20 Message-ID: <3832E7CE.3F41A7F8@cwa.de> References: <80tp1j$f56$1 AT nnrp1 DOT deja DOT com> NNTP-Posting-Host: morgoth.cwa.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [de]C-NECCK (Win95; I) To: djgpp AT Delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Myron Seto schrieb: > > Here's an easy question, for a usually non programmer. I wish to write > a simple C program to calculate the number of days between two dates. What a coincidence. You are the second one to ask this very question today. You don't know Michel Lee by any chance ? Do have a look at the reply I wrote to his request. Basically you can use the "difftime()" function to obtain the difference between two "time_t" values in seconds. The other solution that I mentioned to Michel is to use the scalar date/time functions in the SNIPPETS source code collection: http://www.snippets.org/ -- Stephan initiator of the campaign against grumpiness in c.l.c fight the bug, read the FAQ: http://www.eskimo.com/~scs/C-faq/top.htm