Solved

vb.net if datetime.now > 17:00

Posted on 2014-03-21
3
256 Views
Last Modified: 2014-03-21
Hi experts,

im having a real brain dead kinda day...

I am trying to figure out how to write

if the time is greater than 17:00 UTC then ...

but for the life of my my brain is on holiday one day earlier than the body and i cant think...
0
Comment
Question by:SimonPrice33
  • 2
3 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 39945296
have you tried:

DateTime.UtcNow.Hour>17
0
 

Author Comment

by:SimonPrice33
ID: 39945300
i think so....

its been one of those days...

but got the code now...

 Dim date1 As Date = DateTime.Now.Today & " " & #2:23:30 PM#
        Dim result As Integer = DateTime.Compare(dt, date1)
        Dim relationship As String

        If result < 0 Then
            relationship = "is earlier than"

            MessageBox.Show(relationship)
        ElseIf result = 0 Then
            relationship = "is the same time as"
            MessageBox.Show(relationship)
        Else
            relationship = "is later than"
            MessageBox.Show(relationship)
        End If
0
 

Author Closing Comment

by:SimonPrice33
ID: 39945307
simpler than my comparison :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now