Valentines day gift. Elapsed days using time library?

Hi. Valentines day are coming up and i am trying to build a little thingy for my girlfriend that tells her how many days we have been together. its suppose to update the days everyday.

The project itself is a bunch of components i had laying around and since i don't have a real time clock module at hand i am trying to use the arduino time library and getting updates via ntp time server once a day from another ethernet shield module broadcasting it via a radio module. (the reason is that i have this set up for other projects in the house allready so its pretty easy using what i got at hand).

i have the ntc time working on the ethernet shield and the plan is to broadcast the unix time to the valentines day gift via an rf module to an arduino pro mini with an sparkfun serial 7 segment display. Parse the unixtime data to the time library and do the calculations on the ardu pro mini in the box.

sooo. summary follows. ntc time server >> ethernet shield arduino >> rf module broadcasts unix time >> rf module recieves unix time >> arduino pro mini parses data and does calculations >> shows days elapsed on the serial 7 segment display

The question i have is if the time library has some sort of calculating the elapsed days since some set date. if not , do you have any tips on how i can perform the calculation based on the time library? i tried googling my eyes out to find anybody else that did something similar but havent found anything yet.

Don't know the exact calls but you need something like: days = ( now.toUniXTimeStamp() - startDate.toUnixTimeStamp() ) / (24 * 60 * 60);

Thanks!

i also found this in the time library.

define elapsedDays(time) ( time / SECS_PER_DAY) // this is number of days since Jan 1 1970

maybe that could be of use?

here is a code snippet.

(at the moment of testing im forcing unix time to be some value with the adjust time command.
i still get the wrong values.

The theDateWeGotTogether is calculated with a online calc to the unix time

i still get 4952 days.
and thats over 13 years… hmm

#include <Time.h>
unsigned long theDateWeGotTogether = 1194282000 ; // in unixtime
unsigned long days ; 

void setup() {                
 Serial.begin(9600); 
 adjustTime(1297617495); 

}

void loop() {

days = ((now() - theDateWeGotTogether) / (((24 * 60) * 60))); 
Serial.println(days); 
delay(3000); 
  
}

i probably messed up the calculation a bit.
here is a working code

#include <Time.h>
unsigned long theDateWeGotTogether = 1194282000    ;  //in unixtime
unsigned long days ; 

void setup() {                
 Serial.begin(9600); 
 adjustTime(1297615685); //used to try the code without knowing the right time. just paste in the unixtime you know 
}

void loop() 
{
days = ((now() - theDateWeGotTogether) / 86400); //magic nubmer 86400 is the number of seconds in a day
Serial.println(days); 
delay(3000); 
}

robtillaart: here is the final project. http://vegardpaulsen.wordpress.com/Valentineduino/