logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
Painting
Heart Disease
Horror Literature
Dating
Hiking & Backpacking
SF/Fantasy Books
Healthy Foods


dailyclick
All times in EST

Clairvoyance: 08:00 PM

Full Schedule
g
g ASP Site

BellaOnline's ASP Editor

g

DateDiff Date Function

Guest Author - Lisa Shea

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())

Date and Time Functions

Introduction to ASP Ebook

Download this ebook to get everything you need to know about learning ASP - from a step by step tutorial to function lists, sample code, common errors and solutions, and much more! 101 pages.
This site needs an editor - click to learn more!

Add DateDiff+Date+Function to Twitter Add DateDiff+Date+Function to Facebook Add DateDiff+Date+Function to MySpace Add DateDiff+Date+Function to Del.icio.us Digg DateDiff+Date+Function Add DateDiff+Date+Function to Yahoo My Web Add DateDiff+Date+Function to Google Bookmarks Add DateDiff+Date+Function to Stumbleupon Add DateDiff+Date+Function to Reddit




RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the ASP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2013 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


g features
Best uses for RSS

RSS and its future.

Force Download Dialog box with ASP

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2013 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor