Solved

vb.net if datetime.now > 17:00

Posted on 2014-03-21
3
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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