Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sonsivri/public_html/forum/Sources/Load.php(225) : runtime-created function on line 3

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sonsivri/public_html/forum/Sources/Load.php(225) : runtime-created function on line 3
date/time difference display - Sonsivri
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 12, 2026, 09:33:58 21:33


Login with username, password and session length


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