Solved

vb.net if datetime.now > 17:00

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

20 Experts available now in Live!

Get 1:1 Help Now