ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Intro to ASP



 
French Wedding


DateDiff Date Function



With DateDiff, you can determine the difference between two dates. This lets you see how long it's been since someone last logged in and much more.

The format of the DateDiff function is

DateDiff(code, date1, date2)

Code comes from the table below and indicates what unit of time you are wanting the difference measured in:

CodeTime Span
yyyyYear
qQuarter
mMonth
yDay of year
dDay
wWeekday
wwWeek of year
hHour
nMinute
sSecond


The two dates are the dates which you will be comparing to each other

So to take today's date, a "Last Logon" date and see how many days it's been since your user logged onto your site, you would use:

DateDiff("d", LastLogon, Now())

ASP Date and Time Functions


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2008 Minerva WebWorks LLC. All rights reserved.

French Wedding


Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error