# ASP datediff errors pls help!

**URL:** <https://forum.kirupa.com/t/asp-datediff-errors-pls-help/91448>\
**Category:** Uncategorized\
**Created:** [October 3, 2003, 9:20pm UTC](https://forum.kirupa.com/t/asp-datediff-errors-pls-help/91448 "2003-10-03T21:20:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![boristheblade](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@boristheblade](https://forum.kirupa.com/u/boristheblade)\
**Post date:** [October 3, 2003, 9:20pm UTC](https://forum.kirupa.com/t/asp-datediff-errors-pls-help/91448/1 "2003-10-03T21:20:27Z")

</div>

Hey guys I need a little help here with some asp code. I am trying to get the difference in days between two dates. As you can see in the output the dates ‘created’ and ‘today’ are legit and print out correctly. Whe I use datediff I get 37897 days for the difference, when it should be about 5-8 days or so.

I have tried to remedy this by formating the dates, I’ve tried not formating, I’ve tried just about anything I can think of(which isnt much) :). I am new at asp so any insight is appreciated. thank you so much in advance!

// asp code  
\<%  
createdDate=rs(“created”)  
createdDate = FormatDateTime(createdDate, 2)  
today = FormatDateTime(today, 2)  
numDays=datediff(“d”, created, today)  
response.write(" created " & createdDate)  
response.write(" today " & today)  
response.write(" Difference " & numDays)   
%\>

//OUTPUT

created 9/25/03  
today 10/3/03  
Difference 37897

created 9/26/03  
today 10/3/03  
Difference 37897

created 9/27/03  
today 10/3/03  
Difference 37897

created 10/3/03  
today 10/3/03  
Difference 37897

created 10/3/03  
today 10/3/03  
Difference 37897

created 10/3/03  
today 10/3/03  
Difference 37897
