funny... but i only get 382 days...
anyways...
TheTime=DateDiff("y",Now,"
response.write TheTime
Let me know...
MaxOvrdrv2
Main Topics
Browse All TopicsHi, guys
I'm using DateDiff method to count days...........
<%=DateDiff("d", Now, "04/08/02 00:00:00")*-1%>
... that displays number of days past since 04/08/02.....
Anyone know how to format it to show 1 year 3 moths 3 days instead of something like 456 days.....?
Any ideas are welcome:)
Cheers,
Kouras.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
MaxOvrdrv2
.....I didn't count like you:))
....Look you've got last chance:)
Luke's code is working.....your one is not , but coz your one is much shorter( dunno bout the size of script comparing to Luke's though), that's why I thought I'll wait a bit more, not long though:))
Thanx Luke, I will accept your answer in an hour if nothing else will be available.
Thanx, guys,
Kouras.
BTW: here's all my source for testing it
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" x-undefined>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.
</head>
<body>
<form method = post action = test.asp>
StartDT:
<INPUT type="text" id=txt1 name=txt1><BR>
EndDT:
<INPUT type="text" id=txt2 name=txt2><BR>
<BR>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
<%
If Request.Form("txt1") <> "" and Request.form("txt2") <> "" then
Response.write(YearsMonths
end if%>
<%
Function YearsMonthsDays(StartDate,
'Written by Luke A. Davis
'Please, if you use or distrubute this code,
'please leave comment block in
Years =DateDiff("yyyy", StartDate, enddate)
StartDate=dateadd("yyyy",y
Months=DateDiff("M", startDate, EndDate)
StartDate=dateadd("M", Months, StartDate)
Days=DateDiff("d", StartDate, EndDate)
YearsMonthsDays = Years & "Year(s) " & Months & " Month(s) " & Days & " Day(s)"
End Function
%>
</form>
</body>
</html>
Business Accounts
Answer for Membership
by: luke_davisPosted on 2003-04-25 at 11:56:42ID: 8397442
Just wrote this function... call it insteqad of datediff. 02 00:00:00",now())%> EndDate) ears,Start Date)
<%=YearsMonthsDays("04/08/
<%
Function YearsMonthsDays(StartDate,
'Written by Luke A. Davis
'Please, if you use or distrubute this code,
'please leave comment block in
Years =DateDiff("yyyy", StartDate, enddate)
StartDate=dateadd("yyyy",y
Months=DateDiff("M", startDate, EndDate)
StartDate=dateadd("M", Months, StartDate)
Days=DateDiff("d", StartDate, EndDate)
YearsMonthsDays = Years & "Year(s) " & Months & " Month(s) " & Days & " Day(s)"
End Function
%>