Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime Issue Need some help/suggestions

Status
Not open for further replies.

Ddraig

MIS
Jul 16, 2004
97
US
Howdy,

I'm having an issue with my code and I can't seem to figure it out. I'm trying to make an alert system basically the program goes out to a site(rss feed) checks the time and if the alert is not older than 20 minutes (arbitrary number for coding purposes) then it displays a message (the feed details), But if it is older than 20 minutes then it doesn't display the alert.

So far I can not get the date time to compare the way I want it too. Let me post some of my code, it might be a bit of a mess since I've been going back and forth with it.

If Date.UtcNow.Subtract(System.TimeSpan.FromMinutes(20)) < xNode.selectSingleNode("pubDate").text Then
Messagebox.show("This is a new Alert Message")
Else
Messagebox.Show("No new Alerts")
End If

I am thinking it has something to do with the way my feed is putting in the Date Time and will need to hack the code a bit and fix the date time in it.


Perhaps there is a better way to do this? I'm not familiar with date.compare, but that might also be something useful.
 
It looks like you are using Visual Basic .net. This Forum is for Visual Basic Version 5 and/or 6.

I suggest you re-post your question in the vb.net forum forum796.


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Doh I thought something looked wrong haha. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top