YYYYMMDD conversion to MM/DD/YY

Posted on 2007-10-15
Last Modified: 2008-01-09
Please see the ColdFusion code below.  The data in CStart and CEnd is coming as a number in the form of YYYYMMDD.  Is there an easy way to change this to MM/DD/YY.  thx

<cfquery name="campaign_dates" datasource="Pluto" dbtype="ODBC">

<cfheader name="Content-Disposition" value="inline;filename=CampaignDates.xls">
<cfcontent type="application/msexcel">

<table border="1" cellspacing="1">
    <cfoutput query="campaign_dates">
Question by:ssdanish
    1 Comment
    LVL 51

    Accepted Solution

    One way is to use string functions

    <td>#mid(CStart, 5, 2)#/#right(CStart, 2)#/#mid(CStart, 3, 2)#</td>
    <td>#mid(CEnd, 5, 2)#/#right(CEnd, 2)#/#mid(CEnd, 3, 2)#</td>

    If its something you'll do often, consider putting the logic into a custom function.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Title # Comments Views Activity
    Coldfusion upgrade 9 to 11 4 281
    coldFusion QoQ problem 3 84
    oo coldfusion get inserted id 11 62
    C# script to Coldfusion 25 43
    PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
    CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now