Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateDiff() Usage 1

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello,

I am struggling when using DateDiff() with date the values in a variable in the format of "yyyymmdd".

Do you have to convert a Date to a certain format or "Date" data type to properly use DateDiff()?

Thanks,

Michael42
 
Always eight digits?

Code:
<cfset nDate = "20050117">
<cfset propDate = mid(nDate,5,2) & "/" & mid(nDate,7,2) & "/" & mid(nDate,1,4)>

<Cfoutput>#DateFormat(propDate,"dddd, mmmm dd, yy")#</cfoutput>

Try that.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
webmigit,

Cool - think I just needed to see it in that form. I have it working now.

Thanks for posting,

Michael42
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top