473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

how to add hours?

I have the time in varchar format

10:00:00

I want to add 2 hours to tha above time

in the same way i want to add minitus and seconds also

how to change the type of varchar to time format and do all these calculations?

please help me
Oct 4 '06 #1
3 2377
bplacker
121 100+
I have the time in varchar format

10:00:00

I want to add 2 hours to tha above time

in the same way i want to add minitus and seconds also

how to change the type of varchar to time format and do all these calculations?

please help me

should be able to do "Convert.ToDateTimeFormat()" or something similar.
Oct 4 '06 #2
aplus
14
should be able to do "Convert.ToDateTimeFormat()" or something similar.
Hi..

You can use the code as below:

[C#.NET]

string sTime;
sTime ="10:00:00";

Response.Write(Convert.ToDateTime(sTime).AddHours( 2).ToShortTimeString());

-Ankit
Oct 5 '06 #3
Hi..

You can use the code as below:

[C#.NET]

string sTime;
sTime ="10:00:00";

Response.Write(Convert.ToDateTime(sTime).AddHours( 2).ToShortTimeString());

-Ankit
Hello

I have hours in the integer variable h1

how to add minutes to this variable
Oct 6 '06 #4

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

Similar topics

3
by: George | last post by:
Hi, The sql query below returns data in the 'note' field from a table called ww_rec_1 from the previous month and displays the sum of hours for each category. SELECT note,SUM(hours)FROM...
14
by: anon | last post by:
Does anyone know how many man-hours were used in creating .NET 1.0? I thought it would be an interesting statistic to know. Thanks.
5
by: mitchchristensen | last post by:
I have a transaction log that tracks issues from a call center. Each time an issue is assigned to someone else, closed, etc. I get a time stamp. I have these time stamps for the beginning of an...
5
by: Rebecca Smith | last post by:
I'm building log book to keep track of a racers stats during a long ultra marathon race. Things such as time on the bike, time off, H20 intake, electrolytes and the like. When I say long I mean...
1
by: serge | last post by:
Right now the database I am working with is storing time in an Integer data type and is storing the time value in seconds. The application does not allow entering seconds. It accepts minutes and...
22
by: Drum2001 | last post by:
I have a table that tracks employee times. I have a column (Date/Time). Users, through a form, enter how long it takes them to complete a task. For example, 03:45 = 3 hours and 45 mins. I am...
1
by: Brett | last post by:
Does anyone know how to calculate hours that go over 24? I am tracking how many hours & seconds our production keyers work everyday. When I run a query for a length of time that a given employee...
6
by: richbneal | last post by:
I really like the site so far and this is my first post. I have looked through some of the archives with no luck. I have also read the posting guidelines and will do my best to be clear and accurate...
3
by: sentiald | last post by:
I am having trouble with the following code. I need to have it calculate regular pay, overtime pay and gross pay and display it back to the user. Can anyone figure out where my problem lies. <?php...
1
by: 22dude | last post by:
it says the variable hours is being used with out being initializes i am using C++ 2005 express edition , I am currently student Please help me out to find the solution on my code below #...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.