Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 02:55:09 14:55


Login with username, password and session length


Pages: [1]
Print
Author Topic: date/time difference display  (Read 4173 times)
0 Members and 1 Guest are viewing this topic.
altra22
Guest
« on: July 17, 2010, 10:20:17 22:20 »

Hi, I am doing project to display difference between two dates in days/hours/min/sec.
using PIC16F876A ,DS1302 in c
My date is 3/3/1924 till this moment a count up timer.
the y2k problem still here  Huh when you set the date you must set it in XX format (00-99) just 100 year
Code:
rtc_set_datetime(day,mth,year,dow,hour,min);
or DS1302 isn't suitable for my project ?
any help or sample code appreciated

Thanks in Advance
Logged
zuisti
Senior Member
****
Offline Offline

Posts: 409

Thank You
-Given: 242
-Receive: 780


« Reply #1 on: July 17, 2010, 11:18:04 23:18 »

Hi, I am doing project to display difference between two dates in days/hours/min/sec.
using PIC16F876A ,DS1302 in c
My date is 3/3/1924 till this moment a count up timer.
the y2k problem still here  Huh when you set the date you must set it in XX format (00-99) just 100 year
Code:
rtc_set_datetime(day,mth,year,dow,hour,min);

Use an additional variable for centuries. For example:

Code:
If Year > 23 then
   Century = 19
else
   Century = 20
endif

If you calculate a difference between two dates in days, take the leap years into consideration !
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC