473,498 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TimeSpan problem


I'm sure there's an easy solution to this that I am just not thinkin
of. I am trying to get the total minutes between 2 times. It work
fine except when the ending time crosses over midnight. For instance
I am trying to get the total minutes between 11:59 PM and 12:09 AM.
The subtract method on the TimeSpan object returns a crazy negativ
number. I can't seem to find a work around.

Thanks so much in advance!

--
Rosann
-----------------------------------------------------------------------
Rosanne's Profile: http://www.highdots.com/forums/member.php?userid=28
View this thread: http://www.highdots.com/forums/showthread.php?t=205285

Nov 19 '05 #1
1 1366
Rosanne,

You have to include dates in the values.

Eliyahu

"Rosanne" <Ro************@no-mx.forums.yourdomain.com.au> wrote in message
news:Ro************@no-mx.forums.yourdomain.com.au...

I'm sure there's an easy solution to this that I am just not thinking
of. I am trying to get the total minutes between 2 times. It works
fine except when the ending time crosses over midnight. For instance,
I am trying to get the total minutes between 11:59 PM and 12:09 AM.
The subtract method on the TimeSpan object returns a crazy negative
number. I can't seem to find a work around.

Thanks so much in advance!!
--
Rosanne
------------------------------------------------------------------------
Rosanne's Profile: http://www.highdots.com/forums/member.php?userid=283
View this thread: http://www.highdots.com/forums/showthread.php?t=2052856

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2305
by: Dirk Reske | last post by:
hey, when I do: TimeSpan ts = TimeSpan.FromTicks(System.Enviroment.TickCount); ts.ToString(); I get something like this: 00:00:00.2381474 but I want to see, how many hours,...
2
21011
by: Jeff Shantz | last post by:
Hello, I'm developing a large statistics application for a call center. It often needs to calculate time spanning over months. For example, an agent's total talk time within 30 days. Since an...
2
19048
by: DWalker | last post by:
In Visual Studio (Visual Basic) .NET 2002, I noticed that this: Dim Elapsed as DateTime = Now - Now gives a "compile time" error (error in the IDE), saying that the '-' operator is not...
2
2927
by: ucasesoftware | last post by:
i translate a C# funtion to VB.NET and i have this : Shared Function isAllDay(ByVal ap As Appointment) As Boolean Return ap.DateBegin.TimeOfDay = TimeSpan.Zero AndAlso ap.DateEnd.TimeOfDay =...
13
2114
by: sd00 | last post by:
Hi all, can someone give me some coding help with a problem that *should* be really simple, yet I'm struggling with. I need the difference between 2 times (Target / Actual) However, these times...
2
1052
by: Rob | last post by:
I was just getting started with TimeSpan and I get a error in my first line of code... I write... Dim ts as TimeSpan And Intellisense gives me an error "Type Expected" I did notice that...
5
5499
by: prasanta.bhowmik | last post by:
Hello, I created a object of TimeSpan only with minute and expected the result in hours and minute, but its returning wrong result. My Code is : TimeSpan timeSpan = new TimeSpan(0,2400,0);...
5
1972
by: Vibhesh | last post by:
I am facing problem with TimeSpan structure when DirectX is used. Following is the sample code that causes the problem: ...
4
6215
by: Massimo | last post by:
Hi to All, i'm using C# in .NET 2.0 and i have a DataTable A with a column of type TimeSpan used to store HOUR info. I'm trying to filter my DataTable A selecting only rows that have the column...
2
12584
by: shapper | last post by:
Hello, I have the following: boxStat = new BoxStat { BoxCount = database.Boxes.Count(), SinceLastCreate = (DateTime.Now - database.Boxes.Max(b => b.CreatedAt)).Days ?? 0 };
0
7125
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,...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
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...
0
5464
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,...
0
4593
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...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
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 ...
0
292
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...

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.