i just want to ask if you know a formula, or just VERY SIMPLE codes on how to compute days between two dates? i really don't have an idea on how to make it. thank you!
ronnel09 0 Newbie Poster
Recommended Answers
Jump to Post— deceptikon 1,790Whether it's simple or not depends on how well you know C, but I think the following is trivial:
#include <stdio.h> #include <time.h> int main(void) { struct tm d1 = {0}, d2 = {0}; d1.tm_year = 2012 - 1900; d1.tm_mon = 7; d1.tm_mday = 18; d2.tm_year = …
Jump to Post— asrockw7 18Alternatively,
L = 30 + { [ M + floor(M/8) ] MOD 2 }, where L is the month length in days and M is the month number 1 to 12. The expression is valid for all 12 months, but for M = 2 (February) adjust by subtracting 2 …
All 6 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
thewebhostingdi -7 Junior Poster
asrockw7 18 Junior Poster in Training
ronnel09 0 Newbie Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.