Guyz i need an API for finding diff in time in minutes and days as fast as possible . if anybody has it and can provide me i wud be greatfull

Recommended Answers

All 10 Replies

Century handling is not important can do without it thanx

There is no standard function for that -- you will have to write your own. You could have written it yourself in the time that it took for me to post this response (5 hours).

Ya i have well i needed it a bit urgently so was expecting some one to share a bit of code it cud save a lot of my time ...but still if anybody got any efficient bit of function i wud still appreciate ... @ first i thought it to be easy but slowly got a lot of corner cases to handle

Look dude!!! first of all i wasnt palgiarizing i newer said it was my code and i dont need to work for me just

U better learn wt plagiarizing means and i obviously thought of not spending time on something that basic and i needed it urgently so thought somebody cud share it.. SO GET A LIFE DUDE

man, are you STILL using chatspeak?

have you considered just cutting your losses now, and creating a new account?

Its been 8 hours now and you still have not started writing the code yet! All you have to do is get the two date/times as time_t object, subtract them. The result is the difference in seconds. From that you can easily convert to minutes, hours, days, years, decades or whatever you want.

To get the time_t object, first populate a struct tm structure with the date/time and call mktime(), which returns time_t.

The whole thing might has taken you an hour or so to complete and test. Instead, you have so far wasted 8 hours trying to get someone else to do it for you. Not very efficient use of your time.

well, as he said, it's too basic for him to spend his time on, and its something he needs urgently.

shirish: Also be aware that, for Microsoft compilers, the functions in time.h do not work with dates prior to 1970. Here is a good article how to get around that on MS-Windows os.

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.