Valentines day gift idea

I stumbled across this the other day and thought it would be a cool idea for V-day.

It's a pretty old project so I can't get any help with it from the originator. The code is there but it has way to much in it for my needs. I just want to calculate the days spent together and display them, maybe even put in an anniversary message.
I am very new to this and trying to go through the original code and modify it for my idea is not feasible.
I want to use and arduino nano, a DS1307 RTC module, and an adafruit backpacked 7 segment display.
I basically have a working clock right now running this code. It looks like taking the time to unix would be ideal and then it would just be math from there.

Can someone please help?

CLOCK_DISPLAY.ino (4.97 KB)

Jonarotz:
I stumbled across this the other day and thought it would be a cool idea for V-day.

Valentineduino – Vegard Paulsen

It's a pretty old project so I can't get any help with it from the originator. The code is there but it has way to much in it for my needs. I just want to calculate the days spent together and display them, maybe even put in an anniversary message.
I am very new to this and trying to go through the original code and modify it for my idea is not feasible.
I want to use and arduino nano, a DS1307 RTC module, and an adafruit backpacked 7 segment display.
I basically have a working clock right now running this code. It looks like taking the time to unix would be ideal and then it would just be math from there.

Can someone please help?

If you have unixtime, then it is easy to find the number of days between two unixtimes.

Each day has 86400 seconds and unixtime is the number of seconds since 1/1/1970.

"So unixtime/86400" is the number of days since 1/1/1970.

And if you want to find the difference in days between unixtime2(later) and unixtime1(earlier), it is as easy as that:

int days= unixtime2/86400 - unixtime1/86400.

So what is your math problem?

Do you have unixtimes?

If not, and you only have calendar dates, it is nearly as easy as with unixtime, but you have to do different.

So what do you have? later unixtime2 and earlier unixtime1?
Or calendar dates?
And you want to calculate "number of days between dates, right?
Or something else?

I figured unixtime would be best for this...simple math anyways.
How do I get unixtime from my RTC?

I have an earlier unixtime that I would like to count up from, so yes basically the number of days between that date and the present.

Jonarotz:
I figured unixtime would be best for this...simple math anyways.
How do I get unixtime from my RTC?

How do you read time from your RTC?

Do you use your own routines/functions to read from RTC?
Which timezone is your RTC running in?
Is your RTC running in UTC time (as unixtime is)? Or is your RTC time set to time in different time zone?

Or do you use any library?
In case of library/libraries used: Which library/libraries? Links?