473,545 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

difftime() returning incorrect value

9 New Member
Hi, I am using difftime() to compare two time_t values.If the difference between the two time_t values is 6, difftime() returns 3606.
Can anybody tell me where I am doing a mistake
Jan 27 '10 #1
1 3130
Banfa
9,065 Recognized Expert Moderator Expert
It is unlikely that difftime is wrong (unless you are using some little known and new platform) therefore the mistake is probably in your code, since you haven't posted your code that is rather hard for us to diagnose but I would be interested to know your process for asserting that the difference is 6, did you print out the 2 values being compared?
Jan 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3128
by: collinm | last post by:
hi parseDate(&prod->tmbEndRun, date_rtu); parseTime(&prod->tmbEndRun, prod->htime_rtu_fin); printf("end %s\n", prod->htime_rtu_fin); return me
8
1463
by: tshad | last post by:
I have class method that is passing back a boolean, but it always returns a false; The class is: *************************************************************************** public bool Delete() { int rowsAffected = 0; DbObject myDbObject = new DbObject(); SqlParameter parameters = {
4
3016
by: David Lozzi | last post by:
Howdy, I'm using a WYSIWYG editor called TinyMCE. When I edit some text and then save it back to my SQL server using a SQLCommand, all HTML characters are changed to HTML code, i.e. &gt;strong&lt; instead of <strong> and so on. Is this a problem with the editor or something else? Does .Net convert it? I had to disable page validate request...
3
2101
by: Srinivas Aki | last post by:
Hello Everyone, I'm trying to read a dynamic table into an array and then return it back to the php array so that I can register that for the session. I'm not too sure if i'm going in the right direction though. Javascript follows. function get_ticket_cart(){ var tamt = document.getElementById('tamt'); var tcells = tamt.cells; var total...
6
6521
by: Emmanuel Delahaye | last post by:
Hi, Is there a portable way to convert the value returned by difftime (a number of seconds of type double) in time_t, which, AFAIK, is not a number of seconds. For this reason, I guess, that this code of mine, supposed to give an example about 'how to use time functions correctly' is not portable, is it ?
2
4999
by: phl | last post by:
Hello, I have aspx(say page.aspx) page which uses javascript to submit a form reload with some unicode characters,upon an button event e.g page.aspx?param=value I get this value in the codebehind and access it via Request.Querystring property.
17
2807
by: mac | last post by:
Hi, I'm trying to write a fibonacci recursive function that will return the fibonacci string separated by comma. The problem sounds like this: ------------- Write a recursive function that creates a character string containing the first n Fibonacci numbers - F(n) = F(n - 1) + F(n - 2), F(0) = F(1) = 1 -, separated by comma. n should be...
10
2179
klarae99
by: klarae99 | last post by:
I am working on an Inventory Database in Access 2003. I am having trouble with a report I designed to show current inventory in stock. I have a form (frmInventory) that is unbound. There are four combo boxes on this form that allow the user to select Location, Vendor, Category and SubCategory. These selections (or blank fields) are then passed...
1
2361
by: patrickv | last post by:
Hello All, I have a problem with difftime. I have 2 strings containing a time. I must calculate the difference of this 2 strings into seconds. This is my code: double Seconds; double Timeout; unsigned char firsttime; unsigned char secondtime; char *timestr;
160
5756
by: DiAvOl | last post by:
Hello everyone, Please take a look at the following code: #include <stdio.h> typedef struct person { char name; int age; } Person;
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5984
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.