[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to check if a date is before today's date in asp.net

Posted on 2004-11-04
7
Medium Priority
?
591 Views
Last Modified: 2006-11-17
how to check if a date is before today's date in asp.net
0
Comment
Question by:musclejack
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 6

Accepted Solution

by:
ryerras earned 500 total points
ID: 12495718
lets say you have  dt as the date
then
if(dt < DateTime.Now)
// dt is less than todays date
0
 
LVL 6

Expert Comment

by:ryerras
ID: 12495731
sorry DateTime.Today instead of DateTime.Now -->> this gives todays date with time
0
 
LVL 35

Expert Comment

by:YZlat
ID: 12495856
or use Today.Now
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 35

Expert Comment

by:YZlat
ID: 12495916
Dim today, date1 As DateTime
            today = today.Now
            If (DateTime.Compare(date1, today) > 0) Then
                Response.Write("date1 > today")
            Else
                Response.Write("date1 < today")
            End If
0
 
LVL 9

Expert Comment

by:hismightiness
ID: 12498411
Public Function CheckDates(ByVal _Date As String) As Boolean
     Dim dteValue As Date = CType(_Date, Date)
     Dim dteToday As Date = CType(Now(), Date)
     If dteValue < dteToday Then Return True Else Return False
End Function
0
 
LVL 5

Expert Comment

by:kollu
ID: 12499136
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 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