Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2016, 01:21:45 01:21


Login with username, password and session length


Pages: [1]
Print
Author Topic: date/time difference display  (Read 1642 times)
0 Members and 1 Guest are viewing this topic.
altra22
Guest
« on: July 17, 2010, 11:20:17 23: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: 371

Thank You
-Given: 219
-Receive: 567


« Reply #1 on: July 18, 2010, 12:18:04 00: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