# Cakephp paginator - Modify array value

**URL:** https://discourse.cakephp.org/t/cakephp-paginator-modify-array-value/9258
**Category:** Need Help
**Created:** [April 17, 2021, 1:42am UTC](https://discourse.cakephp.org/t/cakephp-paginator-modify-array-value/9258 "2021-04-17T01:42:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Johnshiva](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@Johnshiva](https://discourse.cakephp.org/u/Johnshiva)
#### Post date: [April 17, 2021, 1:42am UTC](https://discourse.cakephp.org/t/cakephp-paginator-modify-array-value/9258/1 "2021-04-17T01:42:27Z")

</div>

How can i modify the values of pagination result .  
I want to to some computation inside for loops.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/c/cb6de1d497c99db538de3fcb4c85158d843c691d.png)  
 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/5/5060c245f9eeefa41fa96b366388561306ce85e6.png)

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [April 17, 2021, 2:24am UTC](https://discourse.cakephp.org/t/cakephp-paginator-modify-array-value/9258/2 "2021-04-17T02:24:13Z")

</div>

What you’ve got there is, as it says, a ResultSet, not an array. What’s your actual goal here? Why do you need to set this field in these records? The best solution depends very much on what is supposed to happen with the data after this.

---

<div class="post-metadata">

### Author: ![Johnshiva](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@Johnshiva](https://discourse.cakephp.org/u/Johnshiva)
#### Post date: [April 17, 2021, 2:50am UTC](https://discourse.cakephp.org/t/cakephp-paginator-modify-array-value/9258/3 "2021-04-17T02:50:43Z")

</div>

I want to change the date format from 2021-04-07 10:50am to 04/07/2021 10:50am|  
OR  
Adding additional array element from the Pagination result .

---

<div class="post-metadata">

### Author: ![Johnshiva](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@Johnshiva](https://discourse.cakephp.org/u/Johnshiva)
#### Post date: [April 17, 2021, 3:36am UTC](https://discourse.cakephp.org/t/cakephp-paginator-modify-array-value/9258/4 "2021-04-17T03:36:47Z")

</div>

Can i change result set to array ?

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [April 17, 2021, 6:07am UTC](https://discourse.cakephp.org/t/cakephp-paginator-modify-array-value/9258/5 "2021-04-17T06:07:44Z")

</div>

Why would you need to update the format of the date in the actual entities? If it’s because you want the format different in some output, then the output is the place to change it, not in the controller.
