Solved

vb.net if datetime.now > 17:00

Posted on 2014-03-21
3
258 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 70

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 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

8 Experts available now in Live!

Get 1:1 Help Now