By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,425 Members | 2,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,425 IT Pros & Developers. It's quick & easy.

Removing time from date

P: n/a
Hi all

i'm trying to compare a variable containing a date with todays date.

if tempdate <= now()then

trouble is...

tempdate = 05/12/2003
now() = 11/09/2003 14:04:06

how can I get today's date without the time pls

many thanks
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 02/09/2003
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Instead of Now() can't you use Date()

Gram
"xool" <me@memail.net> wrote in message
news:OO*************@TK2MSFTNGP12.phx.gbl...
Hi all

i'm trying to compare a variable containing a date with todays date.

if tempdate <= now()then

trouble is...

tempdate = 05/12/2003
now() = 11/09/2003 14:04:06

how can I get today's date without the time pls

many thanks
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.516 / Virus Database: 313 - Release Date: 02/09/2003

Jul 19 '05 #2

P: n/a
Date :]

Example:

<%

Response.Write "Now returns " & Now & "<br>"
Response.Write "Date returns " & Date & "<br>"
Response.Write "Time returns " & Time

%>

You should use DateDiff for date comparisons like this anyway. Using
DateDiff, it wouldn't matter if the time is in one of your dates if you're
comparing by calendar dates.
http://msdn.microsoft.com/library/en...ctdatediff.asp

Ray at work

"xool" <me@memail.net> wrote in message
news:OO*************@TK2MSFTNGP12.phx.gbl...
Hi all

i'm trying to compare a variable containing a date with todays date.

if tempdate <= now()then

trouble is...

tempdate = 05/12/2003
now() = 11/09/2003 14:04:06

how can I get today's date without the time pls

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.