Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8434847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:46:10+00:00 2026-06-10T06:46:10+00:00

The following code is the output into a table where I have a list

  • 0

The following code is the output into a table where I have a list of dates which are also hyperlinks to an event on that date. It currently displays YMD and I would like it to display DMY.

I have tried using ‘dateFormat’=>’DMY’ in the array but this does not change anything.

Html->link($shiftsession[‘Shiftsession’][‘sessionDate’], array(
‘controller’ => ‘shiftsessions’,
‘action’ => ‘view’,
$shiftsession[‘Shiftsession’][‘SessionID’])); ?>

http://book.cakephp.org/1.2/view/203/options-dateFormat

If anyone could shed some light on how you properly use dateFormat I’d be stoked.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:46:12+00:00Added an answer on June 10, 2026 at 6:46 am

    Good ole’ PHP date() to the rescue:

    <?php
    //use PHP's date() to format the date in any way you'd like
    $theDate = date('DMY', strtotime($shiftsession['Shiftsession']['sessionDate']));
    
    //build the link using the newly formatted date
    $this->Html->link($theDate, array(
        'controller' => 'shiftsessions',
        'action' => 'view',
        $shiftsession['Shiftsession']['SessionID']
    ));
    

    (Obviously you could write that whole thing into one line… for example purposes on StackOverflow, it reads better like this imo)

    With CakePHP:

    CakePHP has a nice Time Helper, but it doesn’t have an option to specify exactly what format you’d like. Instead, it has things like gmt(), and niceShort(), and timeAgo()…etc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: $sql = INSERT INTO table VALUES ('', ...); $result
I have the following code (also in a jsfiddle ): <table> <thead><tr><th>Equation</th><th>Equation</th></tr></thead> <tbody data-bind=template:
I have following piece of code which posts some data into database: $post =
I've got the following code to output a list of items from amazon, but
I'm getting unexpected output when running following code, DateFormat df = new SimpleDateFormat(YYYY-MM-dd); Date
I have the following code in one of my Sql (2008) Stored Procs which
We have a code which extract the service list from our tomcat server and
I have the following code that will count the elapsed time and print the
I have the following code in web2py/python: {{for row in db(db.t_problems.id==db.t_problems(request.args(0))).select(): }} Which grabs
Hi i have the following code which works fine in my machine but when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.