ddmmyyyy read from table but convert in page to show friendly

Posted on 2005-04-25
Last Modified: 2010-04-17

I am storing dates in a table in the format ddmmyyyy (I need this without seperators such as - or / which I know would make easier to convert). I think I need to have a custom strtotime or similar function but can't work it out.

Question by:phreak7t7
    LVL 100

    Expert Comment

    Try something like

    MyDate = Date(right(strDate,4),mid(strDate,3,2), Left(strDate,2))


    Author Comment

    Sorry.. I don't recognise this.. is it php?
    LVL 55

    Accepted Solution

    which programming language?
    For PHP could be something like this:
    $t = mktime(0,0,0,substr($date,2,2),substr($date,0,2),substr($date,4,4));
    echo date("d F, Y", $t);
    LVL 20

    Expert Comment

    What programming language are you using?  The line that mlmcc posted appears "VB like" but the syntax isn't quite right for VB.

         MyDate = cdate(right(strDate,4) & "/" & mid(strDate,3,2) & "/" & left(strDate,2))

    is one way to do it in VB.

    Author Comment

    sorry.. php please
    LVL 55

    Expert Comment

    by:Jaime Olivares
    Already posted PHP, is this what you need?

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    755 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

    21 Experts available now in Live!

    Get 1:1 Help Now