www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/22/03:44:56

Date: 22 Mar 1997 05:33:00 +0100
From: sanasi AT deco DOT franken DOT de (Alessandro Sanasi)
Newsgroups: alt.msdos.programmer,comp.lang.c,comp.os.msdos.djgpp,alt.sb.programmer,comp.os.msdos.programmer
Message-ID: <6TNoPSGPzxB@deco.franken.de>
References: <5gq9ar$efi AT ruby DOT ucc DOT nau DOT edu> <5gtf0l$lk3$1 AT opera DOT iinet DOT net DOT au>
Subject: Re: Help with comparing dates
Organization: KNF Germany
Lines: 19
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 21 Mar 97, jamiei AT potato DOT wa DOT gov DOT au (Jamie Ingram) wrote:

> :-) I have been working with dates for a while and can never get a function
> :-) to compare accurately 100% of the time.  Any help appreciated.

> Why not reorganise the date so that it is YY/MM/DD? Then do a string
> compare. The string compare will return an error level which you can
> use to determine if the date falls between the other two. See below.

How about simply changing the whole date into seconds (like 86400 seconds  
for a day, or 31536000 seconds for each year), and then just compare the  
numbers?

Bye


Alessandro
---
You get what anyone gets. You get a lifetime.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019