473,379 Members | 1,367 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,379 software developers and data experts.

time expressions

cj
How do I say 1 hour in VB.Net.

I'm trying to find out if now - starttime > 1 hour

If Now().Subtract(starttime).ToString > ???????? Then
Mar 16 '06 #1
4 1046
cj.

If now.addhours(-1).ToTicks > Starttime.ToTicks then

I hope this helps,

Cor

"cj" <cj@nospam.nospam> schreef in bericht
news:eP****************@tk2msftngp13.phx.gbl...
How do I say 1 hour in VB.Net.

I'm trying to find out if now - starttime > 1 hour

If Now().Subtract(starttime).ToString > ???????? Then

Mar 16 '06 #2


dim ts as TimeSpan = DateTime.Now.Subtract(startTime)

if (ts.Hours >0) then
Trace.WriteLine("More than an hour has passed since " &
startTime.ToString())
end if
hth,
Alan.

Mar 16 '06 #3
cj
Thanks!

AlanT wrote:

dim ts as TimeSpan = DateTime.Now.Subtract(startTime)

if (ts.Hours >0) then
Trace.WriteLine("More than an hour has passed since " &
startTime.ToString())
end if
hth,
Alan.

Mar 16 '06 #4
cj
Thanks!

Cor Ligthert [MVP] wrote:
cj.

If now.addhours(-1).ToTicks > Starttime.ToTicks then

I hope this helps,

Cor

"cj" <cj@nospam.nospam> schreef in bericht
news:eP****************@tk2msftngp13.phx.gbl...
How do I say 1 hour in VB.Net.

I'm trying to find out if now - starttime > 1 hour

If Now().Subtract(starttime).ToString > ???????? Then


Mar 16 '06 #5

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

Similar topics

3
by: yawnmoth | last post by:
say i wanted to match a string to a regular expression, but i was only given the string one character at a time. one way to do this would be to evaluate the most recently submitted character...
72
by: Raymond Hettinger | last post by:
Peter Norvig's creative thinking triggered renewed interest in PEP 289. That led to a number of contributors helping to re-work the pep details into a form that has been well received on the...
2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
6
by: Clint Olsen | last post by:
What about the following is not computable? It seems that the size of foo is easily computable: typedef struct { char *name; char *data; } Foo; int main(void) {
2
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I...
11
by: CMM | last post by:
I am so disappointed in VS2005. The "little things" wrong with it are just mind-boggling. Boy, I'll be so mad if I have to wait a year for the ".1" release that fixes all the bugs in this obvious...
2
by: baumann | last post by:
Hi, i write static time_t current_time = time(); but the gcc compiler complains: error: initializer element is not constant. I want to know 1, why,
2
by: John Nagle | last post by:
Regular expressions are compiled in ASCII mode unless Unicode mode is specified to "rc.compile". The difference is that regular expressions in ASCII mode don't recognize things like Unicode...
6
by: Charles | last post by:
Hello, I'm trying to extract the home page URL out of a any URL from the same web site For instance if I'm on http://www.regular-expressions.info/javascriptexample.html I want to extract...
22
by: Tomás Ó hÉilidhe | last post by:
I've been developing a C89 microcontroller application for a while now and I've been testing its compilation using gcc. I've gotten zero errors and zero warnings with gcc, but now that I've moved...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?

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.